ex_race_long = c("american indian and alaska native alone", "asian alone",
"black or african american alone", "hispanic or latino",
"native hawaiian and other pacific islander alone",
"some other race alone", "total", "two or more races",
"white alone", "white alone, not hispanic or latino")
tidy_race(ex_race_long)
tidy_age_bins(c("10 to 14 years", "21 years", "85 years and over"))
tidy_parens(c("label one (fake)", "label two (fake)"))
tidy_simplify(c("label one (fake)", "label two (fake)"))
if (FALSE) # requires API key
d = cens_get_acs("B02003", "us", year=2019, survey="acs1")
dplyr::mutate(d, tidy_race_detailed(dtldr_1, dtldr_2, dtldr_3))
Run the code above in your browser using DataLab