get_panel_data {bdl}R Documentation

Get panel data by unit and variable Id's from BDL API

Description

Retrieve data for given units from BDL with specified format.

Usage

get_panel_data(unitId, varId, year = NULL, ggplot = FALSE, ...)

Arguments

unitId

A single 12 character NUTS id code or vector of multiple unit id codes. If multiple unit codes are used, some columns are not available. Use search_units or get_units to find unit id code.

varId

A single Id or vector of variable Id's.Use search_variables or get_variables to find variable id code.

year

A vector of years. If NULL (default) returns data for all available years.

ggplot

Output in a long format suitable for ggplot2. Allows to plot results directly with ggplot function.

...

Other arguments passed on to GET. For example a proxy parameters, see details.

Details

Data to retrieve from The BDL Web Services can be filtered with arguments. To get JSON data from specified directory with custom filters use get_request directly.

To use a proxy to connect, a use_proxy can be passed to GET. For example get_request(id, filters, config = httr::use_proxy(url, port, username, password)).

Value

A dataset as a tibble.

Examples

   # get_panel_data(unitId = "030210101000", varId =  "60270")
   
   # get_panel_data(unitId = "030210101000", varId =  c("60270", "461668"))
   
   # get_panel_data(unitId = c("030210101000", "030210105000", "030210106000"), 
   #                varId =  c("60270", "461668"), year = c(2013:2016))
                          
   # get_panel_data(unitId = c("030210101000", "030210105000", "030210106000"), 
   #                varId =  c("60270", "461668"), ggplot = TRUE)

[Package bdl version 1.0.3 Index]