write_dataset: write_dataset

View source: R/write_dataset.R

write_datasetR Documentation

write_dataset

Description

Saves the data set. Available data sets can be looked up from the web platform (http://econdata.co.za).

Usage

write_dataset(x, method = "stage", ...)

Arguments

x

Data set to upload.

method

Desired method. One of stage or validate. stage will stage the given data making it ready for release. validate will validate the given data against the schema derived from the data structure definition.

...

Further Optional arguments:

file character. File name for saving data set as JSON data to disk.

Details

An EconData account (http://econdata.co.za) is required to use this function. The user must provide an API token that can be found on the Account page of the online portal, a GUI dialog will prompt the user for their API token. Credentials can also be supplied by setting the ECONDATA_CREDENTIALS environment variable using the syntax: "client_id;client_secret", e.g. Sys.setenv(ECONDATA_CREDENTIALS="client_id;client_secret"), when available.

The functionality provided by write_dataset is to save the data set according to the function arguments. As this makes modifications to the database the user calling this function requires higher privileges than needed for other econdatar functions - the user requires membership with the relevant data provider.

Value

No return value, called for side-effects - writes data to server.

See Also

read_dataset write_release

Examples

## Not run: 
x <- read_dataset("MINING")

tmp <- tempdir()

write_dataset(x, file =  file.path(tmp, "mining.json"))

## End(Not run)

coderaanalytics/econdatar documentation built on Nov. 1, 2024, 5:41 a.m.