| unvec_mat | R Documentation | 
From a v \times p matrix of vectorized data and an m \times n
image mask with v in-mask locations, create a list of p
m \times n data arrays in which the mask locations are filled
in with the vectorized data values.
Consider using abind::abind to merge the result into a single
array.
unvec_mat(x, mask, fill_value = NA)
| x | 
 | 
| mask | 
 | 
| fill_value | Out-of-mask value in the output image. Default:
 | 
A list of masked values from x
x <- unvec_mat(
 cbind(seq(3), seq(2,4), seq(3,5)), 
 matrix(c(rep(TRUE, 3), FALSE), ncol=2),
 0
)
y <- array(c(1,2,3,0,2,3,4,0,3,4,5,0), dim=c(2,2,3))
stopifnot(identical(x[[1]], y[,,1]))
stopifnot(identical(x[[2]], y[,,2]))
stopifnot(identical(x[[3]], y[,,3]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.