This function allows the participant attributes and the ID of a given participant to be updated.

saveParticipant(labbcat.url, id, label = id, attributes = NULL)

Arguments

labbcat.url

URL to the LaBB-CAT instance

id

The participant ID - either the unique internal database ID, or their name.

label

The new ID (name) for the participant

attributes

A named list of participant attribute values - the names are the participant attribute layer IDs, and the values are the corresponding new attribute values. The pass phrase for participant access can also be set by specifying a "_password" attribute.

Value

TRUE if the participant's record was updated, FALSE if there were no changes detected.

Details

To change the ID of an existing participant, pass the old/current ID as the id, and pass the new ID as the label.

If the participant ID does not already exist in the database, a new participant record is created.

Examples

if (FALSE) {
## Create a new participant record
saveParticipant(labbcat.url, "Juan Perez", attributes=list(participant_gender="M"))

## Change the name and the gender of the participant record
saveParticipant(labbcat.url, "Juan Perez", "Maria Perez", list(participant_gender="F"))

### Delete the participant we just created
deleteParticipant(labbcat.url, "Maria Perez")
}