apiDownload: Download and transform data from a web API

Description Usage Arguments Details Value Examples

View source: R/apiDownload.R

Description

A high-level function that automates the querying and extraction of data for multiple apirequest objects.

Usage

1
2
apiDownload(x, chunksize=50, pause=0, backupfile="apiDL.list.Rdata", 
shortnames=FALSE, progress="bar", ...)

Arguments

x

a list of apirequest objects

chunksize

numeric, the size (number of requests) that should be processed in one batch (default is 50)

pause

numeric, the number of seconds the download process should be paused after each request (default is 0)

backupfile

character string with the path/name of the backup-file where the data should be saved batchwise during the download process.

shortnames

logical, indicating whether the resulting tables (data frames) should have short variable names (default is FALSE, variable names contain nesting hierarchy)

progress,

either character "bar" (indicates progress with a progress-bar), "text" (textual indication of progress)

...

currently only one parameter (simplify) passed down to the mapping algorithm if simplify is TRUE, the document tree is made simpler if possible (by removing unnecessary nodes)

Details

The core of the function is based on mapiDatalight(). However, it is specifically designed for the processing of various requests and a save download of the data. the requests are split up in batches and saved batchwise on disk during the download process.

Value

either one data frame or a list containing several data.frames into which the tree structured web-data has been transformed.

Examples

1
## Not run: apidata <- apiDownload(x)

umatter/RWebData documentation built on May 6, 2019, 11:47 a.m.