deleteRecords: Delete Records from a Project

View source: R/deleteRecords.R

deleteRecordsR Documentation

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 class 'redcapApiConnection'
deleteRecords(
  rcon,
  records,
  arm = NULL,
  instrument = NULL,
  event = NULL,
  repeat_instance = NULL,
  delete_logging = FALSE,
  ...
)

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

Value

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

See Also

exportRecords(),
importRecords(),
exportRecordsTyped()

Examples

## Not run: 
unlockREDCap(connections = c(rcon = "project_alias"), 
             url = "your_redcap_url", 
             keyring = "API_KEYs", 
             envir = globalenv())
             
# Delete records
deleteRecords(rcon, 
              records = c("1", "2"))


## End(Not run)


redcapAPI documentation built on Oct. 17, 2024, 5:07 p.m.