Learnosity: Ch3_Concept_8_v2
Relative frequency histograms are useful because they allow you to more easily compare distributions across samples of different sizes. In R, it is easier to use a measure called density instead of proportion, and density works better for continuous variables. It's not exactly the same as a proportion, but it's close enough. It will still range from 0.0 to 1.0, and the interpretation is similar.
To create density histograms instead of frequency histograms, use a slightly modified function, gf_dhistogram(), such as in the code window below. Run the code below to create a density histogram of the Age variable from MindsetMatters. Then add the code to produce a basic frequency histogram of the same variable.
# This will create a relative frequency histogram of Age
gf_dhistogram(Age, data = MindsetMatters, fill = "coral2")
# Add code below to create a frequency histogram of Age