Exercises: Modifying factor order

  1. There are some suspiciously high numbers in tvhours. Is the mean a good summary?

  2. For each factor in gss_cat identify whether the order of the levels is arbitrary or principled.

  3. Why did moving "Not applicable" to the front of the levels move it to the bottom of the plot?



Exercises:  Modifying factor levels

  1. How have the proportions of people identifying as Democrat, Republican, and Independent changed over time?

  2. How could you collapse rincome into a small set of categories?


Source: H. Wickham and G. Grolemund, https://r4ds.had.co.nz/factors.html
Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 3.0 License.

Last modified: Tuesday, 3 January 2023, 5:01 PM