dg_call: dg_call()

Description Usage Arguments Value Examples

View source: R/dg_call.R

Description

Makes a call to the Datenguide GraphQL API and returns the results.

Usage

1
2
3
4
dg_call(region_id = NULL, stat_name = NULL, year = NULL,
  substat_name = NULL, parameter = NULL, ipp = 150, nuts_nr = NULL,
  lau_nr = NULL, parent_chr = NULL, full_descriptions = FALSE,
  page_nr = NULL, long_format = TRUE)

Arguments

region_id

Character string containing the ID of a specific region.

stat_name

Character string containing the name of the main statistic. Please see dg_descriptions for a full list.

year

Numeric year(s) for which you want to retrieve the data.

substat_name

Character string containing the name of the sub-statistic. Please see dg_descriptions for a full list. Defaults to all available sub-statistics if not specified.

parameter

Character string containing the name(s) of the parameter(s) you want to retrieve. Please see dg_descriptions for a full list. Defaults to all available parameters if not specified.

ipp

Number that defines the items per page for queries with multiple regions. Default is 150.

nuts_nr

Number defining the NUTS level. 1 refers to NUTS-1, 2 to NUTS-2, and 3 to NUTS-3.

lau_nr

Number defining the LAU level. (At the moment it can only be 1.)

parent_chr

Character string containing the ID of a super-region to which query should be restricted. Should be a region of higher order than nuts_nr oder lau_nr.

full_descriptions

If TRUE, the returning data frame will contain the full descriptions of the statistics as provided by GENESIS. Defaults to FALSE.

page_nr

Page number.

long_format

If TRUE, the returning data frame will be in long format.

Value

Data frame containing the requested data

Examples

1
2
3
4
5
6
7
dg_call(
  region_id = "11",
  year = c(2001, 2007),
  stat_name = "BETR08",
  substat_name = "TIERA8",
  parameter = c("TIERART2", "TIERART3")
)

CorrelAid/datenguideR documentation built on July 25, 2021, 1:43 p.m.