# first we make the new variable
acs12_newagevar <- mutate(acs12, agecat = case_when(age < 14 ~ "child",
age < 18 ~ "teen",
age < 67 ~ "adult",
TRUE ~ "retired"))
# then we filter to remove children
acs12_nokids <- filter(acs12_newagevar, agecat != "child")
# did it work?
table(acs12_nokids$agecat, useNA = "always")
adult retired teen <NA>
1264 297 89 0