scto_read {rsurveycto} | R Documentation |
Read data from a SurveyCTO server
Description
This function can read datasets and forms.
Usage
scto_read(
auth,
ids = NULL,
start_date = "1900-01-01",
review_status = "approved",
private_key = NULL,
drop_empty_cols = TRUE,
convert_datetime = c("CompletionDate", "SubmissionDate", "starttime", "endtime"),
datetime_format = "%b %e, %Y %I:%M:%S %p",
simplify = TRUE
)
Arguments
auth |
|
ids |
Character vector indicating IDs of the datasets and/or forms.
|
start_date |
Date-time or something coercible to a date-time indicating the earliest date-time for which to fetch data. Only used for forms. |
review_status |
String or character vector indicating which submissions to fetch. Possible values are "approved", "pending", "rejected", or any combination of the three. Only used for forms. |
private_key |
String indicating path to private key file. Only needs to
be non- |
drop_empty_cols |
Logical indicating whether to drop columns that
contain only |
convert_datetime |
Character vector of column names in the data for
which to convert strings to datetimes (POSIXct). Use |
datetime_format |
String indicating format of datetimes from SurveyCTO.
See |
simplify |
Logical indicating whether to return only a |
Value
If simplify
is TRUE
and reading one form or dataset, a
data.table
. Otherwise a named list of data.table
s, one for each form
and dataset, along with a data.table
named ".catalog" from
scto_catalog()
.
See Also
scto_auth()
, scto_meta()
, scto_get_form_definitions()
,
scto_get_attachments()
, scto_write()
Examples
## Not run:
auth = scto_auth('scto_auth.txt')
scto_data = scto_read(auth, 'my_form')
scto_db = scto_read(auth)
## End(Not run)