View source: R/support_functions.R
flatten.dims | R Documentation |
Flatten the X and Y dimensions down to a space dimension.
flatten.dims(dat, reduce.dims, names.subset)
dat |
The data to operate on. |
reduce.dims |
The names or indices of the dimensions to reduce to 1 dimension. |
names.subset |
Optionally, a subset of dimension names to copy. |
This function takes input data, a vector of dimensions to reduce to 1 dimension, and optionally a subset of dimnames to copy. It returns the data with the specified dimensions shrunk down to 1 dimension.
The data with the specified dimensions reduced to 1 dimension.
The dimensions to reduce must be adjoining dimensions.
## Take example data and flatten the last two dims down to one. dat <- structure(1:8, .Dim=c(2, 2, 2)) dat.flat <- flatten.dims(dat, 2:3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.