Add a unit column the unit of each measure.
Arguments
- data
downloaded with
cbs4_get_observations()
- ...
not used
Value
original observations data.frame()
with extra Unit
column.
Details
cbs4_add_unit_column()
retrieves the Unit
s for each Measure from
MeasureCodes
in the metadata (cbs4_get_metadata()
) and adds this to the
observations data set.
See also
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
}