Difficulty with using R's `stringr::str_replace_all` for nested data frames with special characters in column names
After trying multiple solutions online, I still can't figure this out. I'm working with an scenario while trying to use `stringr::str_replace_all` on a nested data frame where some column names contain special characters like spaces and punctuation. I have a data frame structured like this: ```r library(tidyverse) nested_df <- tibble( group = c('A', 'A', 'B', 'B'), data = list( tibble(`Value A` = c('100', '200'), `Info-1` = c('x', 'y')), tibble(`Value A` = c('300', '400'), `Info-1` = c('z', 'w')), tibble(`Value B` = c('500', '600'), `Info-2` = c('u', 'v')), tibble(`Value B` = c('700', '800'), `Info-2` = c('t', 's')) ) ) ``` I want to replace all instances of the word "Value" in the column names with "Amount". I attempted the following code: ```r nested_df <- nested_df %>% mutate(data = map(data, ~ rename_with(., ~ str_replace_all(., 'Value', 'Amount')))) ) ``` However, I am getting the following behavior: ``` behavior in str_replace_all(., "Value", "Amount") : could not find function "str_replace_all" ``` I've confirmed that `stringr` is loaded, and I can use other functions from it without scenario. I suspect the question is related to how the column names are accessed. I've also tried using `rename` instead of `rename_with`, but I still faced issues because of the special characters in the column names. What could I be missing? Is there a better way to handle this when dealing with nested data frames and special characters in column names? This issue appeared after updating to R stable.