Checks and removes duplicate subject ids that can happen when misentered during task administration

duplicates_check(
  x,
  id = "Subject",
  unique = c("SessionDate", "SessionTime"),
  n = 1,
  remove = TRUE,
  keep_by = "none",
  save_as = NULL
)

Arguments

x

dataframe

id

Subject ID variable name.

unique

Column names that are unique and should be used to check for duplicate id's (session date and/or time)

n

Number of unique id's expected (default: 1). More than 1 if data file contains multiple sessions per subject id

remove

logical. Remove duplicate ids from data? (default: TRUE)

keep_by

If remove = TRUE, should one or more of the dupilcate id's be kept? options: "none", "first date"

save_as

Folder path and file name to output the duplicate ID's