Description Usage Arguments Value Note Author(s) See Also Examples
Calculate trimmed and/or weighted means of groups of rows in a given data matrix.
1 | combineData(x, y, w, ...)
|
x |
a numeric matrix containing the values whose trimmed and/or weighted mean is to be computed. Each column is treated independently. |
y |
a vector describing the discrete groups used to divide the elements of x. If y is missing then all elements of x are handled together. |
w |
a matrix of weights the same dimensions as x giving the weights to use for each element of x. If w is missing then all elements of x are given the same weight. |
... |
Arguments to be passed to methods (see
|
Returns a matrix of combined numerical data, where each row represents the summary of a group of elements from the corresponding column in x.
Each column in data matrix treated separately.
Reid F. Thompson (rthompso@aecom.yu.edu)
combineData-methods
, mean
, weighted.mean
1 2 3 4 5 6 7 8 9 10 | #demo(pipeline,package="HELP")
x <- 1:100
combineData(x,w=x/100)
weighted.mean(x,w=x/100)
y <- sample(c("a","b","c",1:3),size=100,replace=TRUE)
combineData(cbind(x,x,2*x),y,trim=0.5)
#rm(x,y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.