I have a data frame with "n/a" instead of "NA" and I would like to change the format over the full data frame. I tried using the map() function and the gsub() function together:
vol2 <- vol %>%
map(gsub("n/a", "NA", vol), vol)
Obviously that syntax is a little redundant (and doesn't work), so I was wondering how I might be able to accomplish this.
please clarify; do you want to change the string "n/a" to the string "NA" or to NA_character_ (the special symbol recognised by R as data being character type, though 'missing')
Yes, this would work if I only wanted to do it in one column, but the whole dataframe has the "n/a" in both columns (I only gave you a snippet). If I wanted to do this over all columns, how would I do that? Thanks so much!