gsub_colwise: Apply gsub on string/factor columns of dataframe

gsub_colwiseR Documentation

Apply gsub on string/factor columns of dataframe

Description

Apply gsub on string/factor columns of dataframe

Usage

gsub_colwise(df, pattern, replacement)

Arguments

df

Dataframe with string columns, used as input

pattern

regex to apply

replacement

replacement for pattern

Value

A dataframe like df1, with pattern replaced by replacement in columns

Examples

tibble::tibble(x=c('hello','world'),y=c('a', 'o'))  %>% gsub_colwise('o','u')

capelastegui/sfrpg documentation built on June 13, 2022, 1:38 a.m.