v | R Documentation |
Alternative to the base c()
combine operator that allows one to select
columns by passing unquoted comma-separated column names instead of quoted,
comma-separated column names.
v(...)
... |
a vector of unquoted, comma-separated column names. |
Does not support or combine with other subsetting operators, such as negative indexing or colon: names must be full, individual column names, separated by commas (see examples).
A character vector of quoted, comma-separated, column names.
mt2a <- mtcars[c("am", "cyl", "mpg")]
mt2b <- mtcars[v(am, cyl, mpg)]
identical(mt2a, mt2b) # TRUE
# silly demo
mtlabs <- mtcars
mtlabs <- add_val_labs(
data = mtlabs,
vars = "am",
vals = c(0, 1),
labs = v(a, m) # equivalent to c("a", "m")
)
get_val_labs(mtlabs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.