pxweb: S3 constructor for 'pxweb' api object.

Description Usage Arguments Value Examples

View source: R/pxweb.R

Description

The pxwebapi object contain all information to do calls to the pxweb api and keep count of the number of calls. The object is constructed The object will also be cached in R temp folder to minimize calls to api. All urls should be passed through the constructor to set up the pxweb api config.

Garantuees: The base_url has been pinged The sub_path has been checked The config has been captured from the API The url has been checked to be a pxweb api (through config)

Usage

1
2
3
4
5
6
pxweb(url)

is.pxweb(x)

## S3 method for class 'pxweb'
print(x, ...)

Arguments

url

an url to a pxweb api including language and version of the api. See examples.

x

an an object to test if it is a pxweb object.

...

further arguments supplied to print().

Value

A pxweb object.

Examples

1
2
3
4
5
## Not run: 
pxapi_1 <- pxweb(url ="http://api.scb.se/OV0104/v1/doris/sv/ssd/START/ME/ME0104/ME0104C/ME0104T24")
pxapi_2 <- pxweb(url ="http://api.scb.se/OV0104/v1/doris/sv")

## End(Not run)

pxweb documentation built on Oct. 10, 2021, 1:06 a.m.