Guest User

Untitled

a guest
Jan 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. library(highcharter)
  2. library(dplyr)
  3.  
  4. myData <- pokemon
  5. myData <- myData %>% mutate(type_1 = factor(type_1))
  6.  
  7. myList2 <- myData %>%
  8. group_by(type_1) %>%
  9. summarise(
  10. meanHeight = mean(height),
  11. meanWeight = mean(weight),
  12. meanAttack = mean(attack)
  13. )
  14.  
  15. ggplot(data = pokemon, aes(x=factor(type_1), y=defense)) +
  16. geom_boxplot(aes(fill="")) +
  17. geom_point(data=myList2, aes(x=type_1, y=meanAttack, shape=""), colour =
  18. "orange") +
  19. coord_flip() +
  20. theme(panel.background = element_blank()) +
  21. labs(x = "Pokemon Main Type", y = "Defense value", title = "My pokemon
  22. plot", subtitle = "with a subtitle",
  23. fill = "Type", shape = "Mean Attack",
  24. caption = "data (c) the highcharter package") +
  25. guides(fill=guide_legend(override.aes=list(shape=""))) +
  26. scale_fill_manual('Pokemon types',
  27. values = 'lightblue',
  28. guide = guide_legend(override.aes = list(alpha = 1)))
  29.  
  30. + scale_color_manual('mylegend', ## this does nothing
  31. values = c('yellow'),
  32. guide = guide_legend(title="this", override.aes =
  33. list(alpha = 1)))
Add Comment
Please, Sign In to add comment