gsub_colwise | R Documentation |
Apply gsub on string/factor columns of dataframe
gsub_colwise(df, pattern, replacement)
df |
Dataframe with string columns, used as input |
pattern |
regex to apply |
replacement |
replacement for pattern |
A dataframe like df1, with pattern replaced by replacement in columns
tibble::tibble(x=c('hello','world'),y=c('a', 'o')) %>% gsub_colwise('o','u')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.