ys_add_labels | R Documentation |
Add label attribute to data set columns
ys_add_labels(data, spec, fun = label.ycol)
data |
a |
spec |
yspec object for |
fun |
the function to use for forming |
An error is generated if the names of data
are not identical to names
of spec
.
If the user passes fun
to generate a custom label, the function must take
a single argument, the column ycol
object, and must return the label for
that column as a character vector of length one.
spec <- ys_help$spec()
data <- ys_help$data()
data <- ys_add_labels(data,spec)
sapply(data,attr,"label")
str(data[,1:5])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.