czso_get_table: Retrieve and read dataset from CZSO

Description Usage Arguments Details Value Note See Also Examples

View source: R/core.R


Downloads and reads dataset identified by dataset_id. Unzips if necessary, but only loads CSV files, otherwise returns the path to the downloaded file. Converts types of columns where known, e.g. value columns to numeric.


  dest_dir = NULL,
  force_redownload = FALSE,
  resource_num = 1



a character. Found in the czso_id column of data frame returned by get_catalogue().


character. Directory in which downloaded files will be stored. If left unset, will use the czso.dest_dir option if the option is set, and tempdir() otherwise. Will be created if it does not exist.


integer. Whether to redownload data source file even if already cached. Defaults to FALSE.


integer. Order of resource in resource list for the given dataset. Defaults to 1, the normal value for CZSO datasets.


Structure of the output tibble

CZSO provides its open data as tidy data, so each row only contains one value in the hodnota column and the remaining columns give details on how that value is defined. See "Included columns" below on how these work.

Data types

The schema of the dataset is not yet used, so some columns may be mistyped and are by default returned as character vectors.

Included columns

The range of columns present in the output varies from one dataset to another, so the package does not attempt to provide English-language names for the known subset, as that would result in a jumble of Czenglish.

Instead, here is a guide to some of the common column names you will encounter:

Other metadata will come in the form {variable}_[txt|cis|kod]. The _txt column holds the Czech text name for the category. The _cis column holds the ID of the codelist (register) you need to decode the code in _kod. The English codelists are at, Czech ones at You can find the Czech-language codelists in the catalogue retrieved with czso_get_catalogue(), where their IDs begin with "cis" followed by the number; the English ones can also be retrieved from the link above using a permalink URL.

More conveniently, you can use the czso_get_codelist() function to retrieve the codelist.

Units are denoted in a separate column.

A helper on common breakdowns with their associated columns:

NAs in "breakdown" columns (e.g. gender or age) denote the total.


a tibble, or vector of file paths if file is not CSV or if there are multiple files in the dataset. See Details on the columns contained in the tibble


Do not use this for harvesting datasets from CZSO en masse.

See Also

Other Core workflow: czso_get_catalogue(), get_table()



czso documentation built on March 1, 2021, 5:07 p.m.