Learn R Programming

pxweb (version 0.5.3)

get_dim_size: The function calculates the dimension of a query. That means the numberof categories for each variable downloaded

Description

The function calculates the dimension of a query. That means the numberof categories for each variable downloaded

Usage

get_dim_size(url, dims, content_node = NULL)

Arguments

url
The url the query uses
dims
The dimension object to use for downloading
content_node
Used if already a content node has been downloaded

Value

  • list with two slots [[1]] containes named vector with number of slots [[2]] containes content_node got with get_pxweb_metadata

Examples

Run this code
url <- "http://api.scb.se/OV0104/v1/doris/sv/ssd/BE/BE0101/BE0101A/BefolkningNy"
dims <- list(Region = c('*'), Civilstand = c('*'), Alder = '1', Kon = c('*'),
            ContentsCode = c('*'), Tid = c('*'))
get_dim_size(url, dims)

url <- "http://api.scb.se/OV0104/v1/doris/en/ssd/BE/BE0401/BE0401A/BefolkprognRev2014"
dims <- list(Alder = c('0', '1', '2', '3', '4'),
             Kon = c('1', '2'),ContentsCode = c('BE0401AW'),
             Tid = c('2014', '2015', '2016', '2017', '2018'))
get_dim_size(url, dims)

Run the code above in your browser using DataLab