display_name: Display Names

Description Usage Arguments Details Value Examples

View source: R/dataframes.R

Description

Get or set display names of columns on a data frame

Usage

1
2
3
4

Arguments

col

a column in a data frame

data

a data frame

value

a character vector

Details

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.

Value

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.

Examples

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)
  

edpclient documentation built on May 2, 2019, 2:01 p.m.