pad_vol | R Documentation |
Pad a 3D array by a certain amount in each direction, along each dimension. This operation is like the opposite of cropping.
pad_vol(x, padding, fill = NA)
uncrop_vol(x, padding, fill = NA)
x |
A 3D array, e.g.
|
padding |
A |
fill |
Value to pad with. Default: |
The padded array
x <- array(seq(24), dim=c(2,3,4))
y <- pad_vol(x, array(1, dim=c(3,2)), 0)
stopifnot(all(dim(y) == dim(x)+2))
stopifnot(sum(y) == sum(x))
z <- crop_vol(y)$data
stopifnot(identical(dim(x), dim(z)))
stopifnot(max(abs(z - x))==0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.