ggplot2


          @dichika



             1
@dichika




           2
R             ?

ggplot2




          3
ggplot2




          4
…

            http://had.co.nz/ggplot2/

                   ggplot2

Tsukuba.R

http://www.slideshare.net/syou6162/tsukuba


                     5
6
ggplot2


R

                    base

lattice




             7
ggplot2
 1. ggplot

 2.geom



 3.stat

 4.opts



             8
mtcars

11   32

          (mpg)       (wt)




                  9
1.               ggplot()
ggplot(data=mtcars, aes(x=wt, y=mpg))

data



aes           aesthetic
                          …

x,y

                   10
2.geom
 ggplot()




            geom_point()

            ggplot '   '




                           11
ggplot(data=mtcars,
     aes(x=wt, y=mpg))

     +geom_point()




12
ggplot(data=mtcars,
     aes(x=wt, y=mpg))

     +geom_point(aes(colour=c
     yl))

     +stat_smooth(method=”lm
     ”)




13
3.stat
                …

   stat_smooth(method=”lm”)




                    14
+stat_smooth(method=”lm
     ”)


     95




15
4.opts, labs




          16
+labs(x=”xlabel”,
     y=”ylabel”,
     colour=”legend”)




17
+opts(plot.title=”Motor
     Trend Car Road Tests”)




18
facet, scale, coord

facet

scale



coord            (
        )


            19
qplot
qplot

quick plot

qplot(mtcars, wt, mpeg, geom”point”)

        ggplot()          layer
                             qplot



                     20
ggplot2
          →            (geom_contour)



 2   y             2




              21
twitter

      22
23

ggplot2できれいなグラフ