CLiREN-LMS
Data Cleaning and Preparation in R

Recoding Categorical Variables

Code Example 2

30-45 minutes Applied Step 8 of 10
Code

Code Example 2

8 / 10
Code

Code Example 2

r

sex_lookup <- tibble(
  sex = c(1, 2, 3),
  sex_label = c("Female", "Male", "Not reported")
)

enrollment_recoded <- enrollment_data |>
  left_join(sex_lookup, by = "sex")