Skip to contents

Reset list numbering to be sequential starting from one.

Usage

reset_list(data)

Arguments

data

Raw or merged data. Must have subject and list fields.

Value

Data with a renumbered list field, starting from 1.

Examples

# Data where the list number does not start at 1
subjects_list <- list(1, 1)
study_lists <- list(list("a", "b"), list("c", "d"))
recall_lists <- list(list("b"), list("c", "d"))
list_nos <- list(3, 4)
raw <- table_from_lists(
  subjects_list, study_lists, recall_lists,
  lists = list_nos
)
raw
#>   subject list trial_type position item
#> 1       1    3      study        1    a
#> 2       1    3      study        2    b
#> 3       1    3     recall        1    b
#> 4       1    4      study        1    c
#> 5       1    4      study        2    d
#> 6       1    4     recall        1    c
#> 7       1    4     recall        2    d

# Reset the list number
reset_list(raw)
#>   subject list trial_type position item
#> 1       1    1      study        1    a
#> 2       1    1      study        2    b
#> 3       1    1     recall        1    b
#> 4       1    2      study        1    c
#> 5       1    2      study        2    d
#> 6       1    2     recall        1    c
#> 7       1    2     recall        2    d