服务热线
178 0020 3020
R2-2-1
library("ggplot2")
data1=read.csv("J:\\R\\1108\\R2-2-1.csv",header=TRUE)
ggplot(data1,aes(x=bwt,fill=factor(smoke)))+
geom_histogram(binwidth=400,color='black',position='dodge')+
ggtitle('R2-34')+
xlab('birth weight')+
scale_fill_discrete(labels=c('No','Yes'))
R2-2-2
ggplot(diamonds,aes(x=price,color=color))+
geom_line(stat="density",size=0.5)+
theme_bw()+
xlab("price")+
ylab("density")+
ggtitle("R2-34")
附件