data.frame
,
resamp
, and
series
colMins(x, na.rm=F, dims=1, n=NULL) colMaxs(x, na.rm=F, dims=1, n=NULL) colRanges(x, na.rm=F, dims=1, n=NULL) rowMins(x, na.rm=F, dims=1, n=NULL) rowMaxs(x, na.rm=F, dims=1, n=NULL) rowRanges(x, na.rm=F, dims=1, n=NULL)
bdFrame
.
FALSE
, missing values (
NA
) in the input result in
missing values in corresponding elements of the output.
TRUE
, missing values are omitted from calculations.
x
has dimension higher than 2,
dims
determines what dimensions are summarized.
If
dims=3
and
x
is a 5-dimensional array,
the result of
rowMeans
is a 3 dimensional array consisting of the means
across the remaining 2 dimensions,
and the result of
colMeans
is a 2 dimensional array consisting of the means
across the last 3 dimensions.
x
as a matrix with
n
rows.
For a matrix,
colMins(x)
is equivalent to
apply(x, 2, min)
except possibly for
trivial differences in how
dimnames
are stored. Similarly,
rowMins(x)
matches
apply(x, 1, min)
. Corresponding relationships hold for the other functions.
If there are any missing values, then
apply
is used for the calculations,
and computations are slower.
The
dims
and
n
arguments should not be used for a data frame or
a
bdFrame
.
If
n
is supplied then the result has no
names
or
dimnames
, and
the
dims
argument is ignored.
n
is useful for working with
vectors without converting them to matrices.
x <- matrix(1:12, 4) colMins(x) rowMins(x) colRanges(x) ## Summaries for regular subsets of a vector x <- 1:10 colMins(x, n=5) # like colMins(matrix(x, 5)) ## Higher-dimensional array x <- array(runif(24), dim=c(2,3,4)) rowMins(x) # vector of length 2. rowMins(x, dims=2) # 2x3 matrix. apply(x, 1:2, min) # same as previous colMins(x) # 3x4 matrix. colMins(x, dims=2) # vector of length 4. colMins(aperm(x, c(2,1,3))) # 2x4 matrix