require_tems: Require templates

View source: R/stimlist.R

require_temsR Documentation

Require templates

Description

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

See Also

Template functions auto_delin(), average_tem(), centroid(), change_lines(), delin(), draw_tem(), features(), get_point(), remove_tem(), same_tems(), squash_tem(), subset_tem(), tem_def(), viz_tem_def()

Examples

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

## Not run: 
# 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)

## End(Not run)

webmorphR documentation built on June 2, 2022, 5:07 p.m.