Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Analyzing Survey Data in R

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Create a histogram with a set binwidth
ggplot(data = ___,
       mapping = aes(___)) + 
	geom_histogram(binwidth = ___,
                   color = "white") +
	labs(x = "Hours of Sleep")
Code bewerken en uitvoeren