set_label | R Documentation |
Set the "label" attribute of an object
Copy the label from one variable to another
set_label(x, value, object = FALSE)
copy_label_from(x, from)
x |
the variable to label |
value |
value of the label. If |
object |
if |
from |
the variable whose label must be copied |
An object of the same type as x
, with labels
Dan Chaltiel
get_label()
, import_labels()
, remove_label()
library(dplyr)
mtcars %>%
mutate(mpg2=set_label(mpg, "Miles per gallon"),
mpg3=mpg %>% copy_label_from(mpg2)) %>%
crosstable(c(mpg, mpg2, mpg3))
mtcars %>%
copy_label_from(mtcars2) %>%
crosstable(c(mpg, vs))
mtcars2 %>% set_label(toupper) %>% get_label()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.