{ggplot2}
を紹介しますlibrary(ggplot2)
ggplot(iris, aes(y=Petal.Length, x=Sepal.Length)) +
geom_point()
ggplot(iris, aes(y=Petal.Length, x=Sepal.Length)) +
geom_point()
geom_point()
で「散布図書いて」となるggplot(iris, aes(y=Petal.Length, x=Sepal.Length, col=Species)) +
geom_point()
col=Species
を追加ggplot(iris, aes(y=Petal.Length, x=Sepal.Length, col=Species)) +
geom_point() +
labs(title="iris-tan", x="yokoyoko", y="tatetate")
ggplot(iris,aes(y=Petal.Length,x=Sepal.Length, col=Species)) +
geom_point() +
theme_bw(base_size = 20)
ggplot(iris, aes(y=Petal.Length,x=Species)) +
geom_boxplot()
ggplot(iris, aes(y=Petal.Length,x=Species)) +
geom_boxplot() + geom_jitter()
ggplot(iris, aes(Petal.Length)) +
geom_bar()
## stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.
ggplot(iris, aes(y=Petal.Length, x=Species)) +
stat_summary(fun.y=mean,geom="bar")