Skip to contents

Look up the indices of multiple items in a dataset from a larger pool.

Usage

pool_index(trial_items, pool_items_list)

Arguments

trial_items

The item presented on each trial.

pool_items_list

List of items in the full pool.

Value

Index of each item in the pool. Trials with items not in the pool will be NA. Will be zero-indexed to work with Python functions.

Examples

trial_items <- list("b", "a", "z", "c", "d")
pool_items_list <- list("a", "b", "c", "d", "e", "f")
pool_index(trial_items, pool_items_list)
#> [1]  1  0 NA  2  3