as_stimlist | R Documentation |
Checks if an object is a stimulus or list of stimuli and repairs common problems.
as_stimlist(x)
x |
The object |
Some webmorphR functions, like plot()
and print()
require objects to have a "stimlist" class. If you've processed a list of stimuli with iterator functions like lapply()
or purrr::map()
and the resulting object prints or plots oddly, it is probably unclassed, and this function will fix that.
A stimlist
Stimulus creating functions
animate()
,
blank()
,
new_stimlist()
,
new_stim()
,
read_img()
,
read_stim()
,
read_tem()
,
write_stim()
stimuli <- demo_stim() |> lapply(function(stim) { # remove template lines stim$lines <- NULL return(stim) }) class(stimuli) ## Not run: plot(stimuli) # error ## End(Not run) s <- as_stimlist(stimuli) class(s) plot(s)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.