apldrop(a, b, give.indices=FALSE)
apldrop(a, b) <- value
apltake(a, b, give.indices=FALSE)
apltake(a, b) <- value
Arguments
a
Array
b
Vector of number of indices to take/drop. Length of b
should not exceed length(dim(a)); if it does, an error is
returned.
give.indices
Boolean, with default FALSE meaning to
return the appropriate subset of array a, and TRUE
meaning to return the list of the selected elements in each of the
dimensions. Setting to TRUE is no
value
elements to replace
Details
apltake(a,b) returns an array of the same dimensionality as
a. Along dimension i, if b[i]>0, the first
b[i] elements are retained; if b[i]<0< code="">, the last
b[i] elements are retained.
apldrop(a,b) returns an array of the same dimensionality as
a. Along dimension i, if b[i]>0, the first
b[i] elements are dropped if b[i]<0< code="">, the last
b[i] elements are dropped.0<>
These functions do not drop singleton dimensions. Use drop()
if this is desired.