Description Usage Arguments Details Examples
View source: R/rename_table_pattern.R
simple table name replacement for a given pattern
1 | rename_table_pattern(df, pattern = " ", replacement = "_")
|
df |
dataframe to rename |
pattern |
pattern to replace |
replacement |
value to replace pattern |
a helper to easily wrap around reading tables to perform simple replacement
1 2 3 4 5 6 7 8 9 | ## Not run:
# rename all spaces to underscore
df <- rename_table_pattern(read_table("data/data.csv"))
# rename "-" to "_"
df <- rename_table_pattern(read_table("data/data.csv"), "-", "_")
#rename an existing df
df <-rename_table_pattern(df, "-", "_")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.