PX-Web Data by API
MakeUrl from id
assert_pxweb_data_jsonstat
Assert that x is a correct pxweb_data_jsonstat
object.
Assert a json-stat version 1.0 or later object
assert_pxweb_database_list
Assert that x is a correct pxweb_database_list
object.
assert_pxweb_rda_file_path
Assert that the rda_file_path is correct
Assert that the url structure is correct
Get data from a bottom node in PX-WEB API
Get data dimensions form a bottom node in a PX-Web/PC-Axis API
Check if a response is a pxweb config response
Parse a character string or throws error if it fails
Get and set pxe_metadata_coices
pxe_metadata_variable_names
Get the meta data variable names from a pxweb_explorer
object.
Return the pxweb object at the current position
Interface to PX-WEB APIs from R
Combine pxweb objects
Cite a PXWEB data object
Combine pxweb objects
Get the api catalogue
Get query filter
pxweb_levels_remove_headers
Remove headers from PXWEB levels object
Return options for database, version and language choices
Construct a pxweb_metadata
object.
Assert that the rda_file_path is correct
Assert that the config slot is correct
pxweb_query_dim_splittable
Get vector indicating splittable variables
Get query values
Adding leading zeros
pxweb_validate_query_with_metadata
Validate a pxweb_query
with a pxweb_metadata
object
Build the url to get the config from a PXWEB api
Add default values to pxe
Reorders the dimensions of a get_pxweb_data()
call and checks that all dimensions are correct.
Return base URL to API
build_pxweb_rda_file_path
Build or get the tmp_rda_file_path from an url or pxweb_api_s3 object
Test a full or a part of an pxweb api.
Assert that the url structure is correct
assert_pxweb_api_catalogue
Assert a pxweb_api_catalogue
object
Generate batch permutations
Get content from response
Download data for each bottom node in the pxweb api
assert_pxweb_input_allowed
Assert a pxweb_input_allowed
object
Assert that x is a correct pxweb_levels
object.
Build a path from character elements
Convert a pxweb data objects values to valuetext
Get the url to a table
Refactorized function to get api_file path and copy if needed
Get index of which api has the name or the alias
print.pxweb_api_catalogue_entry
Print a catalogue entry
Build the url to a PXWEB api
Check and compare differences between remote and local api catalogue
Calculates which dimensions that are used as row and col variables in data
Get levels from API node
Get data
Choose an api from api_catalogue
Handle a user input for a pxweb_explorer
object.
Get (allowed) inputs for a pxweb_input_allowed
object.
pxe_position_variable_can_be_eliminated
Can the variable at the current position be eliminated?
choose_pxweb_database_url
Calculate a specific database to get data from
Clean raw data from PX-WEB
Print code to download query
Assert that x is a correct pxweb_database_list
object.
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.
Assert that x is a correct pxweb_metadata
object.
Ask to download and download data
Get the api catalogue from json file
Construct a pxweb_database_list
object.
Traverse node for query alternatives and download data.
Assert a pxweb_query object
pxweb_add_metadata_to_query
Add and remove metadata to query
Move in the pxweb_explorer
position
How many choices has the current position?
Get the api catalogue from github
Defines allowed input for a position in a pxweb_explorer
or character object.
Create a pxweb_explorer
object.
Get input that is consistent with
pxe_position_is_api_catalogue
Is the current position an api_catalogue position?
The function calculates the dimension of a query. That means the numberof
categories for each variable downloaded
Add an api call to a pxweb_api_s3 object
Add the config slot to a pxweb object
pxweb_api_catalogue_entry
Constructor for pxweb_api_catalogue_entry
.
Do a GET call to PXWEB API for advanced users
Get (hard coded) api catalogue github urls
pxweb_get_api_test_data_frame
Build api test data.frame
Get the api name, rootpath, subpath, path or dbpath
Find and download data interactively from a PXWEB API
http_was_redirected
Setup a structure to log all API calls
Find and download data interactively from PX-WEB API
Clear cache of all (or one) pxweb
object
S3 constructor for pxweb
api object.
Create a PXWEB query
Convert a pxweb_query
object to a json
string
Do a GET call to PXWEB API and return a data.frame
Add the subpath slot to a pxweb path slot
Setup temorary directory for the pxweb
Coerce a pxweb_data
object to a data.frame
Convert object to json
Construct a pxweb_data
object.
Assert that x is a correct pxweb_data
object.
pxweb_data_column_comment
Construct a pxweb_data_comment
object
Construct a pxweb_data_comments
object.
Convert a pxweb_query
object to R code
assert_pxweb_data_comments
Assert that x is a correct pxweb_data_comments
object.
The function calculates the dimension of a data object
Fix url characters
Test a full or a part of a PXWEB api.
Do a GET call to PXWEB API
Compue the dimension of the query
Save and load pxweb
objects from R temp folder
pxweb_metadata_add_null_values
Add values to NULL value variables in PXWEB metadata objects
Compue the dimension of a metadata object
split_dimensions_left_right
Split variables into chunks
Pad a string to a fixed size
pxweb_test_create_api_paths
Create all paths from a list of pxweb_api_catalogue entries
Taken from trimws
for reasons of compatibility with previous R versios.
test_pxweb_api_get_node_metadata
Get metadata from all bottom nodes identified with test_pxweb_api_get_nodes . Test time limit object
Get input from user
Construct a pxweb_levels
object.
pxweb_metadata_elimination
Get boolean vector
Function to silently test for existence of metadata and return TRUE or FALSE based on the result of that test.
Parse the response from a PXWEB API
Get the whole node tree from a given pxweb api
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.
Write api catalogue to json file
Functions from sweSCB package that are not called anywhere (yet)
but might be useful later
Function to deparse an URL into its components.
The path to store paths to api.json
Generate permutations of dimensions to find optimal no of batches
Print method for api_parameters.
The path to the folder to store paths to api.json
pxe_position_is_full_query
Is the current position a full query (i.e. choices for all metadata variables)?
Is the current position a metadata object?
pxe_position_multiple_choice_allowed
Are multiple choices allowed?
Get the table title for the current position
A Reference Class to represent an pxweb_api
Get the PXWEB API catalogue
Compute the dimension of the query pxweb_data
object
Construct a pxweb_data_jsonstat
object.
Get query filter
Split query in optimal sub-queries
Change text to url
Download and update the PXWEB API catalogue