Learn R Programming

redcapAPI (version 2.7.4)

vectorToApiBodyList: Convert R Vector To List for the API Call Body

Description

Converts an R vector to a list that will be suitable for makeApiCall.

Usage

vectorToApiBodyList(vector, parameter_name)

Arguments

vector

An atomic vector.

parameter_name

character(1). The REDCap API parameter name.

Functional Requirements

  1. Return a named list.

  2. The name of each element in the list starts with the value of parameter_name

  3. Throw an error if x is not an atomic vector

  4. Throw an error if parameter_name is not a character(1)

Author

Benjamin Nutter with thanks to Philip Chase for showing me how these need to be formatted.