Learn R Programming

⚠️There's a newer version (0.17.0) of this package.Take me there.

pxweb (version 0.4)

R interface to the PX-Web/PC-Axis API

Description

Generic interface for the PX-Web/PC-Axis API. The PX-Web/PC-Axis API is used by organizations such as Statistics Sweden and Statistics Finland to disseminate data. The R package can interact with all PX-Web/PC-Axis APIs to fetch information about the data hierarchy, extract metadata and extract and parse statistics to R data.frame format. PX-Web is a solution to disseminate PC-Axis data files in dynamic tables on the web. Since 2013 PX-Web contains an API to disseminate PC-Axis files. PX-Web/PC-Axis API information can be found at: http://www.scb.se/Grupp/OmSCB/API/API-description.pdf

Copy Link

Version

Install

install.packages('pxweb')

Monthly Downloads

1,436

Version

0.4

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Mans Magnusson

Last Published

September 4th, 2014

Functions in pxweb (0.4)

api_timer

Creates a timer that keeps track of how many calls that has been called during a time period depending on the api configuration. If there can't be another call the function pauses R to do the call.
deparseLevels

Functions from sweSCB package that are not called anywhere (yet) but might be useful later Function to deparse an URL into its components.
interactive_pxweb

Find and download data interactively from PX-WEB API
getContent

Get content from response
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.
test_pxweb_api

Test a full or a part of an pxweb api.
base_url

Return base URL to API
buildPath

Build a path from character elements
get_pxweb_levels

Get levels from API node
get_pxweb_data

Get data from a bottom node in PX-WEB API
get_dim_size

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

Get the whole node tree from a given pxweb api
test_pxweb_api_get_data

Download data for each bottom node in the pxweb api
get_pxweb_metadata

Get data
test_pxweb_api_get_node_metadata

calculate_data_dim

The function calculates the dimension of a data object
print.api_parameters

Print method for api_parameters.
clean_pxweb

Clean raw data from PX-WEB
checkForLevels

Function to silently test for existence of metadata and return TRUE or FALSE based on the result of that test.
download_pxweb

Traverse node for query alternatives and download data.
get_pxweb_dims

Get data dimensions form a bottom node in SCB API
calc_dim_type

Calculates which dimensions that are used as row and col variables in data
pxweb

pxweb
api_parameters

Return options for database, version and language choices