Learn R Programming

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

pxweb (version 0.5.3)

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,132

Version

0.5.3

License

BSD_2_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Mans Magnusson

Last Published

November 30th, 2014

Functions in pxweb (0.5.3)

test_pxweb_api

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

Download data for each bottom node in the pxweb api
get_pxweb_dims

Get data dimensions form a bottom node in a PX-Web/PC-Axis API
text_to_url

Change text to url
calculate_data_dim

The function calculates the dimension of a data object
calc_dim_type

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

Get data
api_catalogue

Get the api catalogue
get_pxweb_levels

Get levels from API node
print.api_parameters

Print method for api_parameters.
choose_pxweb_api

Choose an api from api_catalogue
api_parameters

Return options for database, version and language choices
test_pxweb_api_get_node_metadata

clean_pxweb

Clean raw data from PX-WEB
update_pxweb_apis

Download and update the PXWEB API catalogue
buildPath

Build a path from character elements
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.
base_url

Return base URL to API
get_api_index

Get index of which api has the name or teh alias
get_api_list

Get the api catalogue from json file
choose_pxweb_database_url

Calculate a specific database to get data from
pxweb

pxweb
interactive_pxweb

Find and download data interactively from PX-WEB API
checkForLevels

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

Check and compare differences between remote and local api catalogue
write_api_list

Write api catalogue to json file
findData.input

Get input that is consistent with
get_pxweb_data

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

Get the whole node tree from a given pxweb api
download_pxweb

Traverse node for query alternatives and download data.
get_dim_size

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

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

A Reference Class to represent an pxweb_api
getContent

Get content from response
get_api_list_remote

Get the api catalogue from github
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.
get_github_api_urls

Get (hard coded) api catalogue github urls