服务热线
178 0020 3020
> library("ggplot2")
> mydata1<-read.csv("D:\\learningr\\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-40")+scale_fill_discrete(h=c(0,200),c=400,name="Smoke",labels=c("no","yes"))
library("ggplot2")
> ggplot(diamonds,aes(x=price,colour = color))+geom_line(stat = "density",size = 0.8)+ggtitle("R2-40")
附件