服务热线
178 0020 3020
> library("ggplot2")
> mydata1<-read.csv("C:\\Users\\Administrator\\Desktop\\R2-2.1.CSV",head=TRUE)
> ggplot(mydata1,aes(x=bwt,fill=factor(mydata1$smoke)))+geom_histogram(binwidth = 400,colour="black",position = "dodge")+labs(x="birth weight",title="R2-27")+scale_fill_discrete(h=c(0,200),c=400,name="Smoke",labels=c("no","yes"))
> library("ggplot2")
> mydata1<-read.csv("C:\\Users\\Administrator\\Desktop\\R2-2.1.CSV",head=TRUE)
> ggplot(diamonds,aes(x=price,colour = color))+geom_line(stat = "density",size = 0.5)+ggtitle("R2-27")
附件