drop(x)
x
is an object with a dim
attribute
(e.g. a matrix or array), then drop
, returns
an object like x
, but with any extents of length
one removed. Any accompanying dimnames
attribute
is adjusted and returned with x
.
Array subsetting typically performs this reduction,
but sometimes it is useful to invoke drop
directly.
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