I’m trying to change the Gender variable in my dataset to a character variable (i.e., 1 = male, 2 = female, 3 = other)
The code I attempted to run is the following
bwdata6 <- bwdata6 %>% mutate(across(c(Gender),
~recode(.x, ‘1’ = male, ‘2’ = female, ‘3’ = other)))
The error message I got is below.
Error: Problem with mutate()
input ..1
.
x object ‘male’ not found
i Input ..1
is across(c(Gender), ~recode(.x,
1 = male,
2 = female,
3 = other))
.
What’s going wrong here?