I want to get rid of ages less than 18 in my data set by converting them to missing values using mutate_at. I found A way to do it, but I'm certain that there's a more efficient way. Here's what I have:
dataie = dataselected %>%
mutate_at ("RIDAGEYR", na_if, 0) %>%
mutate_at ("RIDAGEYR", na_if, 1) %>%
mutate_at ("RIDAGEYR", na_if, 2) %>%
...
etc, all the way up to 17.
I'm pretty new to RStudio, so any advice is welcome.