Learn R Programming

redcapAPI (version 2.7.4)

deleteRecords: Delete Records From a Project

Description

Delete records from a project. This is a destructive action that will result in deletion of any events and data associated with the arm. Data loss is non-reversible. The user must have 'Delete Record' privileges in the database.

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

The number of deleted records.

Arguments

rcon

A REDCap connection object as generated by redcapConnection.

records

a vector of record names to be deleted.

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.) NOTE: 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.

...

Additional arguments to pass to other methods.

error_handling

An option for how to handle errors returned by the API. see redcap_error

config

list Additional configuration parameters to pass to POST. These are appended to any parameters in rcon$config.

api_param

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.

REDCap API Documentation

This method allows you to delete one or more records from a project in a single API request.

REDCap Version

At least 8.1.17+ (and likely some earlier versions)

References

Please refer to your institution's API documentation.