Learn R Programming

redcapAPI (version 2.10.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,
  instrument = NULL,
  event = NULL,
  repeat_instance = NULL,
  delete_logging = FALSE,
  ...
)

# S3 method for redcapApiConnection deleteRecords( rcon, records, arm = NULL, instrument = NULL, event = NULL, repeat_instance = NULL, delete_logging = FALSE, ... )

Value

deleteRecords invisibly 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.

instrument

character(1) Optional instrument to delete records from.

event

character(1) Optional event to delete records from.

repeat_instance

numeric(1) optional repeat instance to delete records from.

delete_logging

logical. Should the logging for this record be delete as well. Default to FALSE.

...

Arguments to pass to other methods

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