Using tidyverse, across the entire data frame, replacing any string found on a list, with a string.
df<- tribble(
~x, ~y, ~z,
"a", "95%", "96%",
"b", "99%", "98%",
"c", "astricks", "astricks"
)
high95 <- c("95%", "96%", "97%", "98%", "99%", "100%")
Trying to replace any string in the list (high95) with the string ">95%"
df %>% str_replace(. %in% high95, ">95%")
I am doing this with strings because of suppression changing col to a character format.