sp_get_table: Get a statnipokladna table

sp_get_tableR Documentation

Get a statnipokladna table

Description

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

Usage

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.

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

Original Output English Czech Note
ZC_VTAB vtab table number tabulka -
ZC_UCJED ucjed accounting unit účetní jednotka NB: ucjed != ico; the two codes are different; ICO is universal, ucjed is specific to SP, and both denote an organisation.
ZC_VYKAZ vykaz report number výkaz -
ZFUNDS_CT finmisto accounting centre finanční místo either kapitola or "organizační složka státu" (core state org)
ZC_ICO ico org ID IČO see ucjed
ZC_FUND zdroj funding source zdroj -
ZC_KRAJ kraj region kraj -
ZC_NUTS nuts NUTS code NUTS kód -
ZC_LAU okres NUTS code of LAU1 unit LAU1 kód -

Tables ⁠budget-*⁠

Original Output English Czech Note
ZCMMT_ITM polozka item/line položka (druhové členění) NB: polozka != polvyk
0FM_AREA kapitola chapter kapitola -
0CI_TYPE polozka_type item/line type typ položky -
FUNC0AREA paragraf sector line paragraf (odvětvové členění) -
ZC_PVS pvs programme code programové výdaje státu post-2014
ZC_EDS eds subsidy and proprty evidence Evidenční dotační systém / správa majetku ve vlastnictví státu post-2014, No codelist - perhaps external via https://www.edssmvs.cz/DocumentsList.aspx?Agenda=CEIS
ZC_UCRIS ucris purpose Účel post-2014, no codelist found
0FUNC_AREA paragraf sector line paragraf (odvětvové členění) -
ZU_ROZSCH budget_adopted budget as originally adopted schválený rozpočet -
ZU_ROZPZM budget_amended budget as amended throughout the year rozpočet po změnách -
ZU_KROZP budget_final final budget konečný rozpočet -
ZU_OBLIG budget_oblig ? obligo -
ZU_ROZKZ budget_spending actual spending skuteč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*⁠

Original Output English Czech Note
ZC_POLVYK polvyk item/line položka výkazu -
ZC_SYNUC synuc synthetic account syntetický účet -
ZU_MONET previous_net net, previous period netto minulé období -
ZU_AOBTTO current_gross gross, current period brutto běžné období -
ZU_AONET current_net net, current period netto běžné období -
ZU_AOKORR current_correction correction, current period korekce běžné období -

Tables ⁠profit-and-loss-*⁠

Original Output English Czech Note
ZU_HLCIN previous_core core activity, previous period hlavní činnost, minulé období -
ZU_HOSCIN previous_economic economic activity, previous period hospodářská činnost, minulé období -
ZU_HLCIBO current_core core activity, current period hlavní činnost, běžné období -
ZU_HCINBO current_economic economic activity, current period hospodářská činnost, běžné období -

Table ⁠changes-in-equity⁠

Original Output English Czech Note
ZU_STAVP before previous period stav minulé období -
ZU_STAVPO after current period stav běžné období -
ZU_ZVYS increase increase zvýšení stavu -
ZU_SNIZ decrease decrease snížení stavu -

Table cash-flow

Original Output English Czech Note
ZU_BEZUO current current period běžné účetní období -

Value

a tibble; see Details for key to the columns

See Also

Other Core workflow: add_codelist(), get_codelist(), sp_add_codelist(), sp_get_codelist(), sp_get_dataset()

Examples

## Not run: 
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")

## End(Not run)

petrbouchal/statnipokladna documentation built on April 10, 2024, 3:09 p.m.