rotate | R Documentation |
Rotate templates and images
rotate( stimuli, degrees = 0, fill = wm_opts("fill"), keep_size = TRUE, origin = "image" )
stimuli |
list of stimuli |
degrees |
degrees to rotate |
fill |
background color, see |
keep_size |
whether to keep the original size or expand images to the new rotated size |
origin |
The origin of the rotation. Options are:
A vector of 1 or more point indices (0-based) will rotate around their average position. |
list of stimuli with rotated tems and/or images
Stimulus manipulation functions
align()
,
crop_tem()
,
crop()
,
greyscale()
,
horiz_eyes()
,
image_func()
,
mask_oval()
,
mask()
,
mirror()
,
pad()
,
resize()
,
to_size()
stimuli <- demo_stim() |> resize(0.5) rotate(stimuli, 45, fill = "dodgerblue") rotate(stimuli, 45, fill = "dodgerblue", keep_size = FALSE) # if images are not in the centre of the image, # try setting the origin to tem or specific point(s) offset <- stimuli[1] |> draw_tem() |> pad(0, 250, 0, 0, fill = "dodgerblue") rotate(offset, 45, origin = "image", fill = "pink") rotate(offset, 45, origin = "tem", fill = "pink") # rotate around point 0 (left eye) offset |> crop_tem() |> rep(8) |> rotate(seq(0, 325, 45), origin = 0, fill = "pink") |> animate(fps = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.