1

My code for the Histogram is

hist(rnorm(1000), prob=TRUE)

this gives me the proper histogram, but i need to plot the normal distribution over it. here's the code i tried for that:

curve(rnorm(x, 1000), -4, 1000, add=TRUE)

someone in my class said i needed that range so i threw in a million ideas of what it could be to make the plot (obviously -4,1000 didn't work). An help would be appreciated, I am super confused. it doesn't even throw an error message, R literally doesn't do anything when i run that second code.

jay.sf
  • 60,139
  • 8
  • 53
  • 110

1 Answers1

0

I like the curve solution.

hist(rnorm(1000), prob=TRUE)
curve(dnorm(x), add=TRUE)

enter image description here

jay.sf
  • 60,139
  • 8
  • 53
  • 110