服务热线
178 0020 3020
R2.2
R2.2.1
library("ggplot2")
A <- read.csv("R2-2.1.csv",header=T,row.names=1)
B <- ggplot(A, aes(x=bwt, fill = factor(A$smoke)))
B + geom_histogram(binwidth = 400,position="dodge", color= "black")+ ggtitle("R2-25")+scale_fill_brewer(palette = "Set1", labels = c("NO","YES"),name="Smoke")+xlab("birth weight")
R2.2.2
library("ggplot2")
C <- ggplot(diamonds,aes(x=price, colour =color))
C + geom_line(stat = "density",size =1 )+ggtitle("R2-25")+theme_bw()
附件