服务热线
178 0020 3020
mydata <- read.csv("/Users/Hong/Desktop/data/data3/R2-2.1.csv",header=T)
library(ggplot2)
mydata$smoke <- factor(mydata$smoke)
ggplot(mydata,aes(x=bwt,fill=smoke))+geom_histogram(position="dodge",binwidth=400,color="black")+xlab("birth weight")+ggtitle("R2-37")+scale_fill_discrete(labels=c("No","Yes"))
library(ggplot2)
ggplot(diamonds,aes(x=carat,color=color))+geom_line(stat="density")+xlab("price")+ggtitle("R2-37")+theme_bw()
附件