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.