I was hoping someone could help me because this problem should be really easy to solve, however it's taking me too much time.
I have a df (data) with several columns. In one of the columns (rideable_type) I get one of 3 answers, "docked_bike" "classic_bike" "electric_bike".
I want to turn every "docked_bike" answer into "classic_bike".
When I use
data$rt<-data$rideable_type %>%
set_names(~stringr::str_replace_all(.,"docked_bike", "classic_bike"))
Nothing changes.
When I use
data$rt<-data$rideable_type %>%
dplyr::rename_all(~stringr::str_replace_all(.,"docked_bike", "classic_bike"))
I get an error:
Error in UseMethod("tbl_vars") :
no applicable method for 'tbl_vars' applied to an object of class "character"
Thank you for your time