View source: R/enframed_and_labelled.R
rename_enframed | R Documentation |
tibble
columns according to values in another tibble
.This function renames variables from d
according to the columns in
d.enframed
, which should be in enframed
format (two columns named name
and value
, see tibble::enframe()
for details). It will rename from
according to d.enframed$name
, and to according to d.enframed$value
NOTE:
This function may merit deprecation, because dplyr::rename_with()
, coupled
with lookup()
, deals quite well with this use-case (and is more general).
d.enframed = tibble::enframe(c(a="New A", b="New B"))
rename_enframed(d, d.enframed)
d |
The |
d.enframed |
The |
A tibble that is identical to d
but with renamed columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.