Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(highcharter)
- library(dplyr)
- myData <- pokemon
- myData <- myData %>% mutate(type_1 = factor(type_1))
- myList2 <- myData %>%
- group_by(type_1) %>%
- summarise(
- meanHeight = mean(height),
- meanWeight = mean(weight),
- meanAttack = mean(attack)
- )
- ggplot(data = pokemon, aes(x=factor(type_1), y=defense)) +
- geom_boxplot(aes(fill="")) +
- geom_point(data=myList2, aes(x=type_1, y=meanAttack, shape=""), colour =
- "orange") +
- coord_flip() +
- theme(panel.background = element_blank()) +
- labs(x = "Pokemon Main Type", y = "Defense value", title = "My pokemon
- plot", subtitle = "with a subtitle",
- fill = "Type", shape = "Mean Attack",
- caption = "data (c) the highcharter package") +
- guides(fill=guide_legend(override.aes=list(shape=""))) +
- scale_fill_manual('Pokemon types',
- values = 'lightblue',
- guide = guide_legend(override.aes = list(alpha = 1)))
- + scale_color_manual('mylegend', ## this does nothing
- values = c('yellow'),
- guide = guide_legend(title="this", override.aes =
- list(alpha = 1)))
Add Comment
Please, Sign In to add comment