I am trying to make the table below show a "Y" if the cell is populated. And if the cell is empty it is recoded as an "N"
Below I have provided a image along with the code I am using. In the image, the left column is what I am working with, and the right column is what I'm wanting it to be recoded as.
df <- df %>%
mutate(column1 = recode(column1,
" " = "N",
"If populated" = "Y"))
Any help is appreciated.

df %>% mutate(column1 = ifelse(column1 == " ", "N", "Y"))?