Recoding Data of one column based on another column

Hi!
I want to recode the data of my column B based on column A using mutate function. However, an error state that there is “unexpected symbol”.

Here is the code I used:
harp ← harp_raw %>% # raw data set
clean_names() %>% # standardizing the column names
rename(
dx_year = year_dx, # manually clean column name
dx_month = month_dx, # manually clean column name
dx_age = age_dx, # manually clean column name
provincehuc = province # manually clean column name
) %>%
distinct() %>% # removing duplicates
mutate(across(.cols = where(is.character), .fns = ~na_if(.x, “”))) %>% # manually clean all columns with unknown or missing data
mutate(muncity = recode(muncity, # recode HUC under muncity column
“ILOILO” = “ILOILO CITY”,
“BACOLOD” = “BACOLOD CITY”))
mutate(provincehuc = BACOLOD CITY_if(muncity,“BACOLOD CITY”))

Thank you for your help.

Hello,

It would help if you could provide a reproducible example (reprex), the following post should help with that.

That being said, based on what I can see from your code alone, the issue appears to be the last mutate which doesn’t look to have valid code within it. Could you describe in more detail what you are trying to accomplish with that transformation?

All the best,

Tim

? replace “” with ""