get_scb: Download SCB data

Description Usage Arguments Details Value Examples

View source: R/get_scb.R

Description

get_scb downloads a JSON query to SCB as a data_frame

Usage

1
2
3
4
5
6
7
8
get_scb(
  file = NA,
  query = NA,
  download_data = TRUE,
  save_data = FALSE,
  url = NA,
  returnList = FALSE
)

Arguments

file

File name of JSON query

query

JSON search query as string.

download_data

Boolean indicating whether downloaded or saved data should be used

save_data

Boolean indicating whether downloaded data should be saved to a JSON data file

url

Url string if not a url field in the JSON query

Details

For more info, see:

http://www.github.com/bjornerstedt/scbapi

Value

A data_frame with time as the first column

Examples

1
2
3
4
df <- get_scb("gdpreal.json")
df <- get_scb(
url = "http://api.scb.se/OV0104/v1/doris/sv/ssd/START/PR/PR0101/PR0101A/KPIFastM",
query = '{ "query": []}')

bjornerstedt/scbapi documentation built on Dec. 1, 2019, 3:51 p.m.