Drop Redundant Extent Information
Delete the dimensions of an array which have only one level.
- an array (including a matrix).
xis an object with a
dimattribute (e.g., a matrix or
dropreturns an object like
x, but with any extents of length one removed. Any accompanying
dimnamesattribute is adjusted and returned with
x: if the result is a vector the
namesare taken from the
dimnames(if any). If the result is a length-one vector, the names are taken from the first dimension with a dimname.Array subsetting (
[) performs this reduction unless used with
drop = FALSE, but sometimes it is useful to invoke
drop1 which is used for dropping terms in models.
dim(drop(array(1:12, dim = c(1,3,1,1,2,1,2)))) # = 3 2 2 drop(1:3 %*% 2:4) # scalar product
Looks like there are no examples yet.