Working through an assignment for my stats class, to add a normalcy curve (?) to a histogram. I can create the histogram, but when I type in the code exactly as it appears in the textbook I get an error message:
Here's the code (histsugars is the name of my histogram)
histsugars+stat_function(fun=dnorm, args=list(mean=mean(cereal$sugars, na.rm=TRUE, sd=sd(cereal$sugars, na.rm=TRUE) colour="black" size=1)
And here's the error message:
Error: unexpected symbol in "histsugars+stat_function(fun=dnorm, args=list(mean=mean(cereal$sugars, na.rm=TRUE, sd=sd(cereal$sugars, na.rm=TRUE) colour"
I have NO IDEA what the unexpected symbol is. I've added parenthesis, taken parenthesis away, triple-checked the code against what appears in my textbook, and I am stumped.