Cleans and loads a table. If needed, a dataset containing the table is downloaded.

sp_get_table(
  table_id,
  year,
  month = 12,
  ico = NULL,
  redownload = FALSE,
  dest_dir = NULL
)

Arguments

table_id

A table ID. See id column in sp_tables for a list of available tables

year

year, numeric, 2015-2019 for some datasets, 2010-2020 for others. Can be a vector of length > 1 (see Details for how to work with data across time periods.).

month

month, numeric. Must be 3, 6, 9 or 12. Can be a vector of length > 1 (see details).

ico

ID(s) of org to return, character of length one or more. If unset, returns all orgs. ID not checked for correctness/existence. See https://monitor.statnipokladna.cz/datovy-katalog/prohlizec-ciselniku/ucjed to look up ID of any org in the dataset.

redownload

Redownload even if recent file present? Defaults to FALSE.

dest_dir

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

Value

a tibble; see Details for key to the columns

Details

The data is loaded from files downloaded automatically by sp_get_dataset(); files persist in a temporary directory per session.

How data for different time periods is exported differs by dataset. This has significant implications for how you get to usable full-year numbers or time series in different tables. See vignette("statnipokladna") for details on this.

Data is processed in the following way:

  • all columns are given names that are human-readable and facilitato add codelists

  • ICO (org. IDs) are normalised as in some datasets they are padded with leading zeros

  • a vykaz_date, vykaz_year and vykaz_month columns are created to identify the time period

  • value columns are transformed into numeric

  • other columns are left as character to avoid losing information

Correspondence between input and output columns

Shared/multiple tables

OriginalOutputEnglishCzechNote
ZC_VTABvtabtable numbertabulka-
ZC_UCJEDucjedaccounting unitúčetní jednotkaNB: ucjed != ico; the two codes are different; ICO is universal, ucjed is specific to SP, and both denote an organisation.
ZC_VYKAZvykazreport numbervýkaz-
ZFUNDS_CTfinmistoaccounting centrefinanční místoeither kapitola or "organizační složka státu" (core state org)
ZC_ICOicoorg IDIČOsee ucjed
ZC_FUNDzdrojfunding sourcezdroj-
ZC_KRAJkrajregionkraj-
ZC_NUTSnutsNUTS codeNUTS kód-
ZC_LAUokresNUTS code of LAU1 unitLAU1 kód-

Tables budget-*

OriginalOutputEnglishCzechNote
ZCMMT_ITMpolozkaitem/linepoložka (druhové členění)NB: polozka != polvyk
0FM_AREAkapitolachapterkapitola-
0CI_TYPEpolozka_typeitem/line typetyp položky-
FUNC0AREAparagrafsector lineparagraf (odvětvové členění)-
ZC_PVSpvsprogramme codeprogramové výdaje státupost-2014
ZC_EDSedssubsidy and proprty evidenceEvidenční dotační systém / správa majetku ve vlastnictví státupost-2014, No codelist - perhaps external via https://www.edssmvs.cz/DocumentsList.aspx?Agenda=CEIS
ZC_UCRISucrispurposeÚčelpost-2014, no codelist found
0FUNC_AREAparagrafsector lineparagraf (odvětvové členění)-
ZU_ROZSCHbudget_adoptedbudget as originally adoptedschválený rozpočet-
ZU_ROZPZMbudget_amendedbudget as amended throughout the yearrozpočet po změnách-
ZU_KROZPbudget_finalfinal budgetkonečný rozpočet-
ZU_OBLIGbudget_oblig?obligo-
ZU_ROZKZbudget_spendingactual spendingskutečnost-

Table budget-indicators

| Original | Output | English | Czech | Note | | ZC_PSUK | psuk | budgetary indicator | Závazný a průřezový indikátor | Use psuk codelist |

**Table budget-central-old-subsidies **

| Original | Output | English | Czech | Note | | ZC_ZREUZ | ucelznak | Purpose identifier | Účelový znak | - |

**Table budget-central-old-purpose-grants **

| Original | Output | English | Czech | Note | | 0PU_MEASURE | rozprog | Budgetary programme | Rozpočtový program | - |

Tables balance-sheet*

OriginalOutputEnglishCzechNote
ZC_POLVYKpolvykitem/linepoložka výkazu-
ZC_SYNUCsynucsynthetic accountsyntetický účet-
ZU_MONETprevious_netnet, previous periodnetto minulé období-
ZU_AOBTTOcurrent_grossgross, current periodbrutto běžné období-
ZU_AONETcurrent_netnet, current periodnetto běžné období-
ZU_AOKORRcurrent_correctioncorrection, current periodkorekce běžné období-

Tables profit-and-loss-*

OriginalOutputEnglishCzechNote
ZU_HLCINprevious_corecore activity, previous periodhlavní činnost, minulé období-
ZU_HOSCINprevious_economiceconomic activity, previous periodhospodářská činnost, minulé období-
ZU_HLCIBOcurrent_corecore activity, current periodhlavní činnost, běžné období-
ZU_HCINBOcurrent_economiceconomic activity, current periodhospodářská činnost, běžné období-

Table changes-in-equity

OriginalOutputEnglishCzechNote
ZU_STAVPbeforeprevious periodstav minulé období-
ZU_STAVPOaftercurrent periodstav běžné období-
ZU_ZVYSincreaseincreasezvýšení stavu-
ZU_SNIZdecreasedecreasesnížení stavu-

Table cash-flow

OriginalOutputEnglishCzechNote
ZU_BEZUOcurrentcurrent periodběžné účetní období-

See also

Examples

if (FALSE) { # \dontrun{
allorgs_2018 <- sp_get_table("budget-central", 2018)
allorgs_mid2018 <- sp_get_table("budget-central", 2018, 6)
oneorg_multiyear <- sp_get_table("budget-central", 2017:2018, 12, ico = "00064581")
oneorg_multihalfyears <- sp_get_table("budget-central", 2017:2018, c(6, 12), ico = "00064581")
} # }