您的位置:首页 > 大数据 > 人工智能

[Daily-R] Beginning R 第五章练习

2012-12-11 16:56 92 查看
Ex1: Examine the orchis2 data object. Here you see a two-column data frame with a response variable (flower) and a predictor variable (site). Produce a histogram for the sprayed site. Now overlay a density plot.

ggplot(df, aes(x=value)) + geom_histogram(binwidth=., colour="black", fill="grey") + facet_grid(site ~ .)+ggtitle("Histogram for each site status")+xlab('Flower Number') + ylab('Count')+theme_bw()


with(orchis2, hist(orchis2$flower[orchis2$site=="sprayed"]))

hist(orchis2$flower[orchis2$site=="sprayed"])
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: