0
Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# 関東第3回ゼロはじめるからR言語勉強会ー グラフ

9,045

Published on

6 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total Views
9,045
On Slideshare
0
From Embeds
0
Number of Embeds
22
Actions
Shares
0
0
0
Likes
6
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. 第四回Ｒ勉強会Ｒで作った感動したグラフを紹介
• 2. 1. plotSepal.Length Sepal.Width Petal.Length Petal.Width Species1 5.1 3.5 1.4 0.2 "setosa"2 4.9 3 1.4 0.2 "setosa"3 4.7 3.2 1.3 0.2 "setosa"4 4.6 3.1 1.5 0.2 "setosa"5 5 3.6 1.4 0.2 "setosa"6 5.4 3.9 1.7 0.4 "setosa"7 4.6 3.4 1.4 0.3 "setosa"8 5 3.4 1.5 0.2 "setosa"9 4.4 2.9 1.4 0.2 "setosa"10 4.9 3.1 1.5 0.1 "setosa"
• 3. 1.　plotplot(x,y, ...)> plot(iris[,"Sepal.Length"],iris[,"Petal.Length"])
• 4. 1.　plotplot(iris[,"Sepal.Length"],iris[,"Petal.Length"],xlab = "Sepal Length", ylab = "Petal Length",main = "Iris data: Sepal vs. Petal Length")
• 5. 1.　plotplot(iris[,"Sepal.Length"],iris[,"Petal.Length"],xlab = "Sepal Length", ylab = "Petal Length",main = "Iris data: Sepal vs. Petal Length",col=c("orange3","seagreen4"))
• 6. 1.　plotplot(iris[,"Sepal.Length"],iris[,"Petal.Length"],xlab = "Sepal Length", ylab = "Petal Length",main = "Iris data: Sepal vs. Petal Length",col=c("orange3","seagreen4"))par(bty="l",las=1,bg="antiquewhite1")
• 7. 1.　plotplot(iris[,"Sepal.Length"],iris[,"Petal.Length"],xlab = "Sepal Length", ylab = "Petal Length",main = "Iris data: Sepal vs. Petal Length",col=c("orange3","seagreen4"))legend("bottomright",legend=c("Sepal Length","Petal Length"),fill=c("orange3","seagreen4"),ncol=1,title="Iris data legend")
• 8. ●ggplot2でデータフレームは中心になりました● 色と大きさと形でデータの属性を表せる●ggplot2のグラフは三つのレイヤーで作れる：– Data layer (データフレーム)– Graphics layers (点や線など )– Statistic layers●qplotとggplotの関数でグラフを作ります2. ggplot2
• 9. 2. ggplot2Sepal.Length Sepal.Width Petal.Length Petal.Width Species1 5.1 3.5 1.4 0.2 "setosa"2 4.9 3 1.4 0.2 "setosa"3 4.7 3.2 1.3 0.2 "setosa"4 4.6 3.1 1.5 0.2 "setosa"5 5 3.6 1.4 0.2 "setosa"6 5.4 3.9 1.7 0.4 "setosa"7 4.6 3.4 1.4 0.3 "setosa"8 5 3.4 1.5 0.2 "setosa"9 4.4 2.9 1.4 0.2 "setosa"10 4.9 3.1 1.5 0.1 "setosa"
• 10. 2. ggplot2● qplot(Sepal.Length,Petal.Length,data=iris)● qplot(Sepal.Length,Petal.Length,data=iris,color=Species)● qplot(Sepal.Length,Petal.Length,data=iris,color=Species,size=Petal.Width)● qplot(Sepal.Length,Petal.Length,data=iris,color=Species,size=Petal.Width,alpha=I(0.7))
• 11. 2. ggplot2● qplot(Sepal.Length,Petal.Length,data=iris,color=Species)+geom_rug()● qplot(Sepal.Length,Petal.Length,data=iris,color=Species)+geom_line()● qplot(Sepal.Length,Petal.Length,data=iris,color=Species)+stat_smooth()
• 12. 2. ggplot2labels vals79 rnorm(mean=0,sd=0) 0.7996605396 rexp(rate=0.3) 9.3830294240 rnorm(mean=1,sd=0.5) 0.9357393194 rnorm(mean=-3,sd=3) 1.1291675200 rnorm(mean=-3,sd=3) 6.1559452245 rnorm(mean=1,sd=0.5) 1.0050954…....> head(xy)> qplot(vals,data=xy,col=labels,fill=labels,alpha=I(.3),size=I(.8),geom="density")
• 13. 3. shiny●Node.jsを使って統計的なアプリをWEBにアップことができる● 対話的なデータアプリを目指す●サーバとUIはずっとR言語で作れる