View source: R/charvecs_to_named_charvec_tc.R
charvecs_to_named_charvec_tc | R Documentation |
Takes two character vectors as inputs, writes code declaring a named character vector onto the clipboard. Useful for creating 1:1 maps when recoding variable names.
charvecs_to_named_charvec_tc(names, values)
names |
character vector with the names for the named character vector written to clipboard |
values |
character vector with the values for the named character vector written to clipboard |
old.varnames <- c("v1", "v2", "v3")
new.varnames <- c("age", "height", "weight")
charvecs_to_named_charvec_tc(new.varnames, old.varnames)
# Now paste to see that this text is on your clipboard:
# c('age' = 'v1',
# 'height' = 'v2',
# 'weight' = 'v3')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.