Plotting variations
The preparation is done; now let's explore stat_summary()
.
Summary statistics refers to a combination of location (mean or median) and spread (standard deviation or confidence interval).
These metrics are calculated in stat_summary()
by passing a function to the fun.data
argument. mean_sdl()
, calculates multiples of the standard deviation and mean_cl_normal()
calculates the t-corrected 95% CI.
Arguments to the data function are passed to stat_summary()
's fun.args
argument as a list.
The position object, posn_d
, and the plot with jittered points, p_wt_vs_fcyl_by_fam_jit
, are available.
This exercise is part of the course
Intermediate Data Visualization with ggplot2
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
p_wt_vs_fcyl_by_fam_jit +
# Add a summary stat of std deviation limits
___