move_to_newcol: Move to New Column

Description Usage Arguments Details Examples

View source: R/move_to_newcol.R

Description

Use regex to identify values and move them to a new column, replacing original with NA

Usage

1
move_to_newcol(df, col1, col2, my.regex)

Arguments

my.old.col.name

Column from which value will be moved leaving behind NA

my.new.col.name

Name of new column that will contain values.

my.regex

Regular expression

df

dataframe

Details

Wrapper for str_detect

Examples

1
2
3
 
x <- tibble(col1 = letters[1:5])
move_to_newcol(x, col1, col2, "[a]")

ctmann/nettles.toolbox documentation built on May 14, 2019, 12:29 p.m.