服务热线
178 0020 3020
任务1
library('ggplot2') data<-read.csv(file.choose()) ggplot(data,aes(x=bwt,fill=factor(data$smoke)))+geom_histogram(binwidth=500,colour="black",position="dodge")+ggtitle("R2-01")+xlab("birth weight")+scale_fill_discrete(h=c(0,200),c=400,name="Smoke",labels = c("no","yes"))
任务2
library("ggplot2") diamonds$color <- as.factor(diamonds$color) ggplot(diamonds,aes(x =carat,color = color))+geom_density(size =2)+ ylab("density")+xlab('price')+ggtitle('R2-01')
附件