| pad | R Documentation |
Add padding to sides of stimuli. This is a convenience function to calculate offsets for crop().
pad(stimuli, top = 10, right = top, bottom = top, left = right, ...)
stimuli |
list of stimuli |
top, right, bottom, left |
number of pixels or proportion (<1) to pad each side |
... |
additional arguments to pass to |
The value for top is copied to bottom and right, and the value for right is copied to left, so setting only top produces a consistent border, while setting just top and right sets different borders for top-bottom and right-left. (This convention will be familiar if you use CSS.)
Padding size values are interpreted as a proportion of width or height if less than 1.
list of stimuli
Stimulus manipulation functions
align(),
crop_tem(),
crop(),
greyscale(),
horiz_eyes(),
image_func(),
mask_oval(),
mask(),
mirror(),
resize(),
rotate(),
to_size()
stimuli <- demo_stim()
# default 10-pixel padding
pad(stimuli, fill = "dodgerblue")
# change pad width and set fill
pad(stimuli, 2, fill = "dodgerblue")
# set top border to 10% height
# different colour for each image
pad(stimuli, 0.1, 1, 1, 1,
fill = c("hotpink", "dodgerblue"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.