服务热线
178 0020 3020
library(ggplot2) data<-read.csv('E:/R2-2.1.csv') ggplot(data,aes(x=bwt,fill=factor(smoke)))+ geom_histogram(binwidth=400,color='black',position='dodge')+ ggtitle('R2-02')+ xlab('birth weight')+ scale_fill_discrete(labels=c('No','Yes'))
ggplot(diamonds,aes(x=carat,color=color))+ geom_line(stat="density")+ xlab("price")+ ggtitle("R2-02")+ theme_bw()
附件