cbs4_add_unit_column: Add unit column to observations

View source: R/cbs4_add_unit_column.R

cbs4_add_unit_columnR Documentation

Add unit column to observations

Description

Add a unit column the unit of each measure.

Usage

cbs4_add_unit_column(data, ...)

Arguments

data

downloaded with cbs4_get_observations()

...

not used

Details

cbs4_add_unit_column() retrieves the Units for each Measure from MeasureCodes in the metadata (cbs4_get_metadata()) and adds this to the observations data set.

Value

original observations data.frame() with extra Unit column.

See Also

cbs4_get_metadata()

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

Examples

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

  obs_unit <- cbs4_add_unit_column(obs)
  obs_unit # with unit column
}

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