scto_write {rsurveycto}R Documentation

Write data to a SurveyCTO server

Description

This function updates an existing dataset using a web POST request, as uploading data is not officially supported by the SurveyCTO API.

Usage

scto_write(
  auth,
  data,
  dataset_id,
  dataset_title = dataset_id,
  append = FALSE,
  fill = FALSE
)

Arguments

auth

scto_auth() object.

data

data.frame to upload.

dataset_id

String indicating ID of existing dataset.

dataset_title

String indicating title of dataset. Will replace the existing title, regardless of append.

append

Logical indicating whether to append or replace the dataset.

fill

Logical indicating whether to implicitly fill missing columns with NAs, i.e., whether to allow a mismatch between columns of the existing dataset and columns of data. Only used if append is TRUE.

Value

A list with elements:

See Also

scto_auth(), scto_meta(), scto_read(), scto_get_form_definitions(), scto_get_attachments()

Examples

## Not run: 
auth = scto_auth('scto_auth.txt')
r = scto_write(auth, data, 'my_dataset', 'My Dataset')

## End(Not run)


[Package rsurveycto version 0.1.6 Index]