Skip to contents

Merge separated study and recall events that have the same subject, list, and item.

Usage

merge_lists(
  study,
  recall,
  merge_keys = NULL,
  list_keys = NULL,
  study_keys = NULL,
  recall_keys = NULL,
  position_key = "position"
)

Arguments

study

Information about all study events. Should have one row for each study event.

recall

Information about all recall events. Should have one row for each recall attempt.

merge_keys

Columns to use to designate events to merge. Default is list(‘subject’, ‘list’, ‘item’), which will merge events related to the same item, but only within list.

list_keys

Columns that apply to both study and recall events.

study_keys

Columns that only apply to study events.

recall_keys

Columns that only apply to recall events.

position_key

Column indicating the position of each item in either the study list or the recall sequence.

Value

Merged information about study and recall events. Each row corresponds to one unique input/output pair.

Examples

study <- data.frame(
  subject = c(1, 1), list = c(1, 1), position = c(1, 2), item = c("a", "b")
)
recall <- data.frame(subject = 1, list = 1, position = 1, item = "b")
merge_lists(study, recall)
#>   subject list item input output study recall repeat intrusion
#> 1       1    1    a     1    NaN  TRUE  FALSE      0     FALSE
#> 2       1    1    b     2      1  TRUE   TRUE      0     FALSE