I've met a weird problem that I can't figure it out totally. I'm supposed to add a normal distribution line upon a histogram.I input every step's code but after typing lines function there's no response. I don't know what's wrong.Hope anyone help me! MY code are:
grades<-mydata$Exam1
hist(grades,breaks=20,freq=T) #A correct histogram comes out.
mean(grades,na.rm=T) #there is NA in the column so I remove it when calculating mean.
[1] 75.15278
sd(grades,na.rm=T)
[1] 16.97443
x<-seq(0,100,0.01)
y<-dnorm(x,mean=mean(grades,na.rm=T),sd=sd(grades,na.rm=T))
lines(x,y)#and there's no response!no line showed up!
Is anything wrong with my code? Thanks for your help!