write_database: write_database

View source: R/write_database.R

write_databaseR Documentation

write_database

Description

Create or update a data set (metadata including series and their metadata).

Usage

write_database(x, method = "update", ...)

Arguments

x

Data set to upload.

method

Desired method. One of create or update. create will create a new data set with the provided metadata. update (default) will update an existing data set in the database.

...

Further optional arguments:

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

Details

An EconData account is required to use this function. The user must provide an API token, which 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. However, an admin account must be used when creating the data set (a user with a provision agreement can update).

The functionality provided by write_database is to save the data set (structure) onto EconData's server. It is like putting out a bucket, before filling it with water. Very large datasets may need to be stripped of data and updated in chunks, as the API does not accept messages that are too long. Please Sys.sleep(0.7) in-between each loop.

Value

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

See Also

read_database

Examples

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

write_database(x)

## End(Not run)

coderaanalytics/econdatar documentation built on Feb. 19, 2025, 10:37 p.m.