If you can't read please download the document
Upload
takashi-minoda
View
2.642
Download
2
Embed Size (px)
DESCRIPTION
Tokyo.R 用 資料ggplot2
Citation preview
2.
3. 4. 5. ggplot2 6. 7. 8. 9. 10. 11.
12. Twitter aad34210 13. http://pracmper.blogspot.com/ 14. 15. 16. Web 17. 18.
19. 20.
21. 2
22. Uwe Ligges URL
23.
24. LiggesCRAN 25. 26.
27. 28. 29. 30.
31. 32. ggplot2 33. ggplot2
34. R http://had.co.nz/ggplot2/ 35. ggplot2
36. 37.
38. library(ggplot2) CRAN Japan(Hyogo) Japan(Tsukuba) MacOS 39. 40.
41. + geom_() : 2 42. + xlim( , ) + ylim( , ) 43. + xlab(X )+ ylab(Y )
44.
ggplot~,qplot 45. 46.
47. data(diamonds) 48. 49. caratcut color clarity depth table pricexyz 50. 10.23IdealESI261.555326 3.95 3.98 2.43 51. 20.21PremiumESI159.861326 3.89 3.84 2.31 52. 30.23GoodEVS156.965327 4.05 4.07 2.31 53. 40.29PremiumIVS262.458334 4.20 4.23 2.63 54. 50.31GoodJSI263.358335 4.34 4.35 2.75 55. 60.24 Very GoodJVVS262.857336 3.94 3.96 2.48 56. cut , carat X qplot(cut, data = diamonds) ggplot(diamonds , aes(cut)) + geom_bar() qplot(carat, data = diamonds) ggplot(diamonds , aes(carat)) + geom_bar() qplot(carat, data = diamonds, binwidth = 1) ggplot(diamonds , aes(x = carat)) + geom_bar(binwidth = 1) qplot(carat, data = diamonds, binwidth = 0.1) ggplot(diamonds , aes(x = carat)) + geom_bar(binwidth = 0.1) qplot(carat, data = diamonds, binwidth = 0.01) ggplot(diamonds , aes(x = carat)) + geom_bar(binwidth = 0.1) 57. depth Cut qplot(depth, data = diamonds, binwidth = 0.2, fill = cut) + xlim(55, 70) ggplot(diamonds , aes(depth , fill = cut)) + geom_bar(binwidth = 0.2) + xlim (55 , 70) depth Cut qplot(depth, data = diamonds, binwidth = 0.2) + xlim(55, 70) + facet_wrap(~ cut) ggplot(diamonds , aes(depth)) + geom_bar(binwidth = 0.2) + xlim(55 , 70) + facet_wrap(~cut) (hexbin) qplot(log10(carat), log10(price), data = diamonds,geom = "hex", bins = 10) + facet_wrap(~ cut) 58. price carat qplot(price, carat, data = diamonds, colour = I("blue")) ggplot(diamonds , aes(x = price , y = carat)) + geom_jitter(colour = I("blue") ) - ggplot(diamonds , aes(price , carat)) + geom_jitter(colour = I("blue") )+ geom_smooth(colour = "red")- ggplot(diamonds , aes(price , carat)) + geom_jitter() + geom_smooth(method = "lm") http://had.co.nz/ggplot2/geom_smooth.html 59. price carat qplot(price, carat, data = diamonds, alpha = I(1/10)) qplot(price, carat, data = diamonds, alpha = I(1/50)) qplot(price, carat, data = diamonds, alpha = I(1/100)) qplot(price, carat, data = diamonds, alpha = I(1/250)) 60. Boxplot movie ggplot(movies , aes(x = mpaa , y = rating)) + geom_jitter() ggplot(movies , aes(x = mpaa , y = rating)) + geom_jitter(aes(colour = rating)) ggplot(movies , aes(x = mpaa , y = rating)) + geom_jitter(aes(colour = rating)) + geom_boxplot() 61. 62.
63. qplot(x , y , data , geom = ())~~
64. qplot geom = c(jitter , boxplot) c() 65. 66.
SlideShare(Hadly Wickham)
67. m(__)m