I have a dataset of 503 numbers ranging from -0.8 to 2.7 down one Excel column. I'm looking to sample the normal distribution by using dnorm through the following:
plot(x=seq(from=-1,to=3,by=0.01),
datNorm2 <- dnorm(x, mean=dat$x[1], sd=dat$x[2]),
plot(datNorm2))
where dat$x[1] is the mean and dat$x[2] is the standard deviation of the data. When I run this, I receive the "'x' and 'y' lengths differ error. Can someone help me understand why?