I have a data frame contain a column for age(numeric)
. I used this code to categorize them ta into ages groups? however, the variable appears as false true NA
My data name metsother
agecategory <- metsother %>%
mutate(metsother$Age == case_when(
metsother$Age >= 18 & metsother$Age <= 40 ~ "Category 1",
metsother$Age >= 41 & metsother$Age <= 60 ~ "Category 2",
metsother$Age >= 61 & metsother$Age >= 80 ~ "Category 3"))