Pads an array with a given value at the edges and optionally between elements.
Arguments
- x
(
arrayish)
The array to pad. Can be any data type;valueis brought to it.- value
(
arrayish)
Scalar value to use for padding. It is brought tox's data type: an R value is built at it when its category can reach it (0Lserves an integer and a floatxalike,0only a float one), and a value that already has a data type is converted unless that would narrow it – anf64padding value for anf32xis an error rather than a silent narrowing.- low
(
integer())
Amount of padding to add at the start of each axis.- high
(
integer())
Amount of padding to add at the end of each axis.- interior
(
integer()|NULL)
Amount of padding to add between elements in each axis. IfNULL(default), no interior padding is applied.
Value
(arrayish)
Has x's data type. Each axis grows by
low + high, plus interior between
every pair of elements; negative edge padding trims.
See also
prim_pad() for the underlying primitive.