Description Usage Arguments Details Value Examples
Get or set display names of columns on a data frame
1 2 3 4 | display_name(col)
display_name(col) <- value
display_names(data)
display_names(data) <- value
|
col |
a column in a data frame |
data |
a data frame |
value |
a character vector |
In EDP, columns in a population can have "display names," which are
human-readable names, often longer than the regular names
.
display_name
and display_name<-
get and set these on a single
column. display_names
and display_names<-
get and set them on
all columns of a data frame at once. The setters are used when preparing a
data frame to build a population from. The getters can be applied to results
from select
and simulate
.
display_name
returns a single-element character-vector.
display_names
returns a character vector with as many elements as the
data frame has columns. If a column has no display name set, the
corresponding element will be NA
.
1 2 3 4 | d <- data.frame(inc = c(25, NA, 17), age = c(21, 70, 30))
display_name(d$inc) <- "income (thousands of USD)"
dn <- display_names(d) # returns c(inc = "income (thousands of USD)", age = NA)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.