od_table: Create a table-instance from an open-data dataset

View source: R/od_table.R

od_tableR Documentation

Create a table-instance from an open-data dataset

Description

od_table(id) returns an R6-class object containing all relevant data and metadata from https://data.statistik.gv.at/data/

Usage

od_table(id, language = NULL, server = "ext")

Arguments

id

the id of the dataset that should be accessed

language

language to be used for labeling. "en" or "de"

server

the OGD-server to be used. "ext" (the default) for the external server or prod for the production server

Value

The returned objects is of class sc_table and inherits several parsing methods from sc_data. See od_table_class for the full class documentation.

Components

Component Corresponding File on Server
⁠$data ⁠ ⁠https://data.statistik.gv.at/data/${id}.csv⁠
⁠$header ⁠ ⁠https://data.statistik.gv.at/data/${id}_HEADER.csv⁠
⁠$field(code) ⁠ ⁠https://data.statistik.gv.at/data/${id}_${code}.csv⁠
⁠$json ⁠ ⁠https://data.statistik.gv.at/ogd/json?dataset=${id}⁠

Examples

x <- od_table("OGD_krebs_ext_KREBS_1")

## metadata
x
x$meta
x$field("Sex")
x$field(3)

## data
x$data
x$tabulate()

## tabulation: see `?sc_tabulate` for more examples
x$tabulate("Reporting year", "Sex")

## switch language
x$language <- "de"
x
x$tabulate()

## other interesting tables
od_table("OGD_veste309_Veste309_1")
od_table("OGD_konjunkturmonitor_KonMon_1")
od_table("OGD_krankenbewegungen_ex_LEISTUNGEN_1")
od_table("OGD_veste303_Veste203_1")

STATcubeR documentation built on April 3, 2025, 7:31 p.m.