cbs4_add_label_columns: Add understandable labels to a table

View source: R/cbs4_add_label_columns.R

cbs4_add_label_columnsR Documentation

Add understandable labels to a table

Description

Add columns with labels to the dataset.

Usage

cbs4_add_label_columns(data, ...)

Arguments

data

downloaded with cbs4_get_data()

...

not used

Details

cbs4_add_label_columns() adds for the Measure and each <Dimension> column an extra column MeasureLabel ( <Dimension>Label) that contains the Title of each code, making the table more digestible. Title and other metadata can also be found using cbs4_get_metadata().

Value

original dataset with extra label columns. See details.

See Also

cbs4_get_metadata()

Other add metadata columns: cbs4_add_date_column(), cbs4_add_unit_column()

Examples

if (interactive()){
  # works on observations
  obs <- cbs4_get_observations("84287NED", Perioden="2019MM12")
  obs # without label columns

  obs_labeled <- cbs4_add_label_columns(obs)
  obs_labeled

  # works on data
  d <- cbs4_get_data("84287NED", Perioden="2019MM12")
  d # cbs4_get_data automagically labels measure columns.

  d_labeled <- cbs4_add_label_columns(d)
  d_labeled
}

statistiekcbs/cbsccb documentation built on April 8, 2022, 2:38 a.m.