Learn R Programming

redcapAPI (version 2.8.0)

deleteRecords: Delete Records from a Project

Description

These methods enable the user to delete records from a project.

Usage

deleteRecords(rcon, records, arm = NULL, ...)

# S3 method for redcapApiConnection deleteRecords( rcon, records, arm = NULL, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

Value

deleteRecords returns a character value giving the number of records deleted.

Arguments

rcon

A redcapConnection object.

records

character or integerish. Record ID's to be returned.

arm

integerish. the arm number of the arm in which the record(s) should be deleted. This can only be used if the project is longitudinal with more than one arm. If the arm parameter is not provided, the specified records will be deleted from all arms in which they exist. Whereas, if arm is provided, they will only be deleted from the specified arm.

...

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.

See Also

exportRecords(),
importRecords(),
exportRecordsTyped()

Examples

Run this code
if (FALSE) {
unlockREDCap(connections = c(rcon = "project_alias"), 
             url = "your_redcap_url", 
             keyring = "API_KEYs", 
             envir = globalenv())
             
# Delete records
deleteRecords(rcon, 
              records = c("1", "2"))

}

Run the code above in your browser using DataLab