Retrieves a data table based on the name of the table

get_table(
  name,
  area = c("free", "user", "all"),
  compress = FALSE,
  startyear = 1900,
  endyear = 2100,
  timeslices = NULL,
  regionalvariable = NULL,
  regionalkey = NULL,
  job = NULL,
  stand = NULL,
  language = getOption("genesis_language"),
  genesis = getOption("genesis")
)

Arguments

name

Code of the variable (e.g. retrieved using catalogue_variables)

area

Area in which the object is stored:

  • "free" = objects in the public catalogue

  • "user" = objects saved to "Meine Tabellen"

compress

Should empty rows and columns be discarded?

startyear, endyear

Only retrieve data between these years

timeslices

Number of latest time slices to retrieve -- independent of/cumulative to startyear and endyear

regionalvariable

Code of the regional variable whose value is specified in regionalkey to filter the results

regionalkey

One or more regional keys. Multiple values can be supplied as a character vector or as a single string, with the regional keys separated by commas. Use of wildcard (*) possible.

job

Should a job be created if the table cannot be created immediately?

stand

Only retrieve data updated after this date (dd.mm.yyyy)

language

Search terms, returned messages and data descriptions in German ("de") or English ("en")?

A default value can also be set to the global option genesis_language via options(), e.g. options(genesis_language = "de").

genesis

Which GENESIS database should be used?

One of: "destatis", "regionalstatistik", "bildungsmonitoring", "bayern", "nrw", "sachsen-anhalt".

A default value can also be set to the global option genesis via options(), e.g. options(genesis = "destatis"), so that genesis does not have to be specified in the function call.

Value

A data.frame (or tbl_df if tibble package is installed)

Examples

if (FALSE) {
options(genesis = "destatis")
get_table("12411-0001", startyear = 1960, endyear = 1969)
# Filter results by region
# ("KREISE": administrative districts; "01001": Flensburg)
get_table("12411-0015", regionalvariable = "KREISE", regionalkey = "01001")

options(genesis = "regionalstatistik")
# Get large table by creating a background processing job
get_table("12711-01-03-4", job = TRUE)
# List jobs you've created
catalogue_jobs()
# After the job is finished, you can retrieve the table with `get_table()`
# with `name` set to the name of the job.
}