Question: ggplot ( data = dairy _ queen, aes ( x = cal _ fat ) ) + geom _ blank ( ) + geom _
ggplotdata dairyqueen, aesx calfat
geomblank
geomhistogramaesy density..
statfunctionfun dnorm, args cmean dqmean, sd dqsd col "tomato"
After initializing a blank plot with geomblank the ggplot package within the tidyverse allows us to add additional layers. The first layer is a density histogram. The second layer is a statistical function the density of the normal curve, dnorm. We specify that we want the curve to have the same mean and standard deviation as the column of calories from fat. The argument col simply sets the color for the line to be drawn. If we left it out, the line would be drawn in black.
Based on the this plot, does it appear that the data follow a nearly normal distribution?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
