Skip to contents

Checks a list of stimuli for templates and omits images without a template. If all_same = TRUE, checks that all the templates are the same type. Errors if no images have a template or not all templates are the same (when all_same == TRUE).

Usage

require_tems(stimuli, all_same = FALSE)

Arguments

stimuli

list of stimuli

all_same

logical; whether all images should have the same template

Value

list of stimuli with tems

Examples

stimuli <- demo_stim()
have_tems <- require_tems(stimuli)

if (FALSE) {
# produces an error because no tems
no_tems <- stimuli |> remove_tem()
require_tems(no_tems)

# warns that some images were removed
mix_tems <- c(stimuli, no_tems)
have_tems <- require_tems(mix_tems)

# produces an error because tems are different
demo_tems() |> require_tems(all_same = TRUE)
}