meta_rename | R Documentation |
'meta_rename' allows fast replacement of variable names by key-value pairing with a metadata file.
meta_rename(df, metadata, old, new)
df |
A data.frame object for renaming. |
metadata |
A data.frame object containing the key-value pair |
old |
An unquoted string of the key column name in the metadata object |
new |
An unquoted string of the value column name in the metadata object |
'data.frame' object with new names as per key-value pairs.
testdata <- tibble(a = 0L, b = 0L, c = 0L) meta <- tibble(DatasetPositon = 1:3, VariableID = letters[1:3], VariableType = "integer", VariableLabel = c("item1", "item2", "item3"), ItemText = c("This is item 1", "This is item 2", "This is item 3") ) meta_rename(testdata, metadata = meta, old = VariableID, new = VariableLabel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.