CommencerCommencer gratuitement

Survey-weighted histograms

If we want to understand the distribution of nightly sleep for Americans, we should construct a histogram. Let's do that now and see the impact of changing the width of the bins.

Cet exercice fait partie du cours

Analyzing Survey Data in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create a histogram with a set binwidth
ggplot(data = ___,
       mapping = aes(___)) + 
	geom_histogram(binwidth = ___,
                   color = "white") +
	labs(x = "Hours of Sleep")
Modifier et exécuter le code