Learn R Programming

pxweb (version 0.5.3)

create_batch_list: The function takes an url and a dims object and calculates if this needs to be downloaded in batches due to download limit restrictions in the pxweb api. If '*' is used it will get the numberof values for this dimension using a get_pxweb_metadata call.

Description

The function takes an url and a dims object and calculates if this needs to be downloaded in batches due to download limit restrictions in the pxweb api. If '*' is used it will get the numberof values for this dimension using a get_pxweb_metadata call.

Usage

create_batch_list(url, dims)

Arguments

url
The url to download from.
dims
The dimension object to use for downloading

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('*'))
batches <- create_batch_list(url, dims)

url <- "http://api.scb.se/OV0104/v1/doris/sv/ssd/PR/PR0101/PR0101E/Basbeloppet"
dims <- list(ContentsCode = c('*'),
            Tid = c('*'))
batches <- create_batch_list(url, dims)

Run the code above in your browser using DataLab