Description Usage Arguments Details Examples
View source: R/move_to_newcol.R
Use regex to identify values and move them to a new column, replacing original with NA
1 | move_to_newcol(df, col1, col2, my.regex)
|
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 |
Wrapper for str_detect
1 2 3 |
x <- tibble(col1 = letters[1:5])
move_to_newcol(x, col1, col2, "[a]")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.