Learn R Programming

WGCNA (version 1.43)

pquantile: Parallel quantile, median, mean

Description

Calculation of ``parallel'' quantiles, medians, and means, across given arguments.

Usage

pquantile(prob, ...)
pmedian(...)
pmean(...)

Arguments

prob
A number or vector of probabilities at which to calculate the quantile. See quantile.
...
Numeric arguments. All arguments must have the same dimensions. See details.

Value

  • A vector or array containing the quantiles, medians, or means. The dimensions are determined by the dimensions of the input arguments and whether the prob input is scalar or a vector. If any of the input variables have dimnames, the first non-NULL dimnames are copied into the output.

Details

Given the argumens, say x,y,z, of equal dimensions, the pquantile calculates and returns the quantile of the first components of x,y,z, then the second components, etc. Similarly, pmedian and pmean calculate the median and mean, respectively.

See Also

pmin and pmax for analogous functions for minimum and maximum,

quantile, median, mean for the underlying statistics.

Examples

Run this code
# Generate 2 simple matrices
a = matrix(c(1:12), 3, 4);
b = a+ 1;
c = a + 2;

# Set the colnames on matrix a

colnames(a) = spaste("col_", c(1:4));

# Example use

pquantile(prob = 0.5, a, b, c)
pquantile(prob = c(0, 0.5, 1), a,b, c);

pmean(a,b,c)
pmedian(a,b,c)

Run the code above in your browser using DataLab