Learn R Programming

redcapAPI (version 2.8.0)

surveyMethods: Export Survey Participant Information

Description

These methods enable the user to export information relating to survey participants.

Usage

exportSurveyParticipants(rcon, instrument, event, ...)

exportSurveyLink(rcon, record, instrument, event, repeat_instance = 1, ...)

exportSurveyQueueLink(rcon, record, ...)

exportSurveyReturnCode( rcon, record, instrument, event, repeat_instance = 1, ... )

# S3 method for redcapApiConnection exportSurveyParticipants( rcon, instrument = NULL, event = NULL, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

# S3 method for redcapApiConnection exportSurveyLink( rcon, record, instrument, event = NULL, repeat_instance = 1, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

# S3 method for redcapApiConnection exportSurveyQueueLink( rcon, record, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

# S3 method for redcapApiConnection exportSurveyReturnCode( rcon, record, instrument, event = NULL, repeat_instance = 1, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

Value

exportSurveyParticipants returns a data frame with the columns:

emailThe e-mail address of the participant.
email_occurrenceThe number of times the invitation has been sent (after the next invite).
identifierParticipant identifier (if it exists) to match the survey response to a participant.
recordRecord ID of the participant.
invitation_sent_statusBoolean value indicating if a survey invitation has been sent.
invitation_send_timeDate/time the survey invitation was sent.
response_statusBoolean value indicating if the participant has responded.
survey_access_codeThe participant's survey access code.
survey_linkThe participant's survey link.
survey_queue_linkThe participants' survey queue link.

exportSurveyLink returns a character(1) giving the link for the user to access the survey form.

exportSurveyQueueLink returns a character(1) giving the survey queue link for the user.

exportSurveyReturnCode returns a character(1) giving the survey return code for the user.

Arguments

rcon

A redcapConnection object.

record

character(1) or integerish(1). The record ID of a survey participant.

instrument

character(1). The name of a survey instrument.

event

character(1) The event name of the event for which participant information should be exported.

repeat_instance

integerish(1). The repeat instance if the instrument is designated as a repeating instrument. Default value is 1.

...

Arguments to pass to other methods

error_handling

character(1). One of c("error", "null"). An option for how to handle errors returned by the API. see redcapError().

config

A named list. Additional configuration parameters to pass to httr::POST(). These are appended to any parameters in rcon$config.

api_param

A named list. Additional API parameters to pass into the body of the API call. This provides users to execute calls with options that may not otherwise be supported by redcapAPI.

Functions

  • exportSurveyParticipants(): Export survey participants for a survey instrument.

  • exportSurveyLink(): Export a survey participant's survey instrument link.

  • exportSurveyQueueLink(): Export a survey participant's survey queue link.

  • exportSurveyReturnCode(): Export a survey participant's instrument return code.

Examples

Run this code
if (FALSE) {
unlockREDCap(connections = c(rcon = "project_alias"), 
             url = "your_redcap_url", 
             keyring = "API_KEYs", 
             envir = globalenv())
             
# Export survey participants
exportSurveyParticipants(rcon, 
                         instrument = "survey_form")
                         
# Export survey participants for an event
exportSurveyParticipants(rcon, 
                         instrument = "survey_form", 
                         event = "event_1_arm_1")
                         
# Export survey link
exportSurveyLink(rcon, 
                 record = 1, 
                 instrument = "survey_form")
                 
# Export survey queue link
exportSurveyQueueLink(rcon, 
                      record = 1)
                      
# Export survey return code
exportSurveyReturnCode(rcon, 
                       user = 1, 
                       instrument = "survey_form")
}

Run the code above in your browser using DataLab