I am trying to replace NA values in one column by the values in another column (same row) and tried the following code but it is not working.
Code I tried from research online and answer in Posit community (Replace "NA" with values from another column):
DF <- DF %>% mutate(pm25 = ifelse(is.na(pm25), prop25, pm25))
My column names are different as my data set is different but I think I otherwise applied this code correctly.
When I print the result, the NA values are still there, so this code does not appear to work.
I am working with data in tydverse so I think I have a tibble rather than a dataframe. Is that why it i snot working? If so, what is the code to use that is equivalent but would work for a tibble? Or is my issue different? Thanks for any advice.