knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(dataobservatory, quietly = TRUE)
data("small_population")
small_population_dataset <- dataset (x= small_population,
                                     dataset_code = "small_population_total",
                                     dataset_title = "Population of Small European Countries",
                                     freq = "A",
                                     unit = "NR",
                                     unit_name = "number")

The codebook S3 class (not yet fully documented and does not have yet and independent constructor) records the statistical processing metadata of a dataset. It as a print method.

It contains a full codebook following SDMX statistical metadata codelist standards, furthermore, it records the Session Information of all processing steps, and adds to the descriptive metadata the R packages or software code that generated the results.

small_population_codebook <- codebook_dataset (small_population_dataset)
is.codebook(small_population_codebook)
small_population_codebook

Frequency of Observation {#freq}

For example, the annual observations follow the SDMX Code List for Frequency 2.1 (CL_FREQ)) definition, and they can be translated to the ISO 8106 time metadata standard, too.

add_frequency("A", "list")

Observation Status {#obs_status}

The add_obs() implements the SDMX Code List for Observation Status 2.2 (CL_OBS_STATUS) defintiion for observation status.

Furthermore, with Estimated values and Imputed values, the software code and computational environment information can be recoded (with add_related_items()).

add_obs("E", "list")

Unit information {#unit}

Only Eurostat uses hundreds of codelists, most of them for various measurement information. Currently the unit information is not validated in the package. However, this is not a problem when data is imported from other statistical services, because they apply appropriate unit information.

add_unit("M_EUR", "Million euros", 
         admin_format = 'list')

Consolidated Coodbook

consolidated_codebook <- codebook()
is.codebook(consolidated_codebook)
print(consolidated_codebook)


dataobservatory-eu/dataobservatory documentation built on Jan. 7, 2022, 8:55 p.m.