~/talk

Working with categorical data in R without losing your mind

Talkat rstudio::conf 2019 · 2019-01-15..01-18· [data-science]
slides:none on file

Shows concrete failures with R factors — numeric-to-level conversion giving wrong numbers, lost counts when levels mismatch, a trailing space turning values into NA — using the General Social Survey as the running example. Demonstrates robust fixes with base R and the tidyverse and highlights the forcats functions forcats, stringsAsFactors=TRUE historical pitfalls, and practical defenses like running summary/assertion tests and checking factor levels across training/testing splits. Watch if needing repeatable, safer workflows for categorical wrangling.

AI-written summary · about

  1. 0:00Introduction
  2. 0:30Practical Data Science for Stats
  3. 1:19Teaching introductory statistics classes
  4. 2:40Categorical data
  5. 3:44Why categorical data
  6. 4:32Writing the paper
  7. 4:48The paper
  8. 5:14Factors behave unexpectedly
  9. 6:27Reading as factors
  10. 6:55Strings as factors
  11. 8:26Why you need factors
  12. 9:13Ugly factors code
  13. 10:42Bad approaches
  14. 13:35Robust approaches
  15. 14:00Hadley Wickham
  16. 15:40Cheat Sheet
  17. 16:31Comparison
  18. 18:05Defensive coding
  19. 19:32Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.