od_pool {OptimalDesign} | R Documentation |
Pool of a vector
Description
A function pool.fun
is applied to all the elements of a vector val
that appear within the groups formed by identical rows of a matrix X
.
Usage
od_pool(X, val=NULL, pool.fun="sum", echo=TRUE)
Arguments
X |
the |
val |
a real vector of length |
pool.fun |
a string denoting the function to be applied to the subgroups of elements of |
echo |
Print the call of the function? |
Details
This function is useful for plotting (and understanding) of designs of experiments with more factors than the dimension of the plot.
Value
A list with components:
call |
the call of the function |
X.unique |
the matrix of unique rows of |
val.pooled |
the vector of the length |
Note
The function performs a non-trivial operation only if some of the rows of X
are identical.
Author(s)
Radoslav Harman, Lenka Filova
See Also
Examples
v1 <- c(1, 2, 3); v2 <- c(2, 4, 6); v3 <- c(2, 5, 3)
X <- rbind(v1, v1, v1, v1, v2, v3, v2, v3, v3)
val <- c(1, 2, 7, 9, 5, 8, 4, 3, 6)
od_pool(X, val, "sum")
# The result $val.pooled is a vector with components:
# 19 (=1+2+7+9) because the first 4 rows of X are identical
# 9 (=5+4) because the 5th and the 7th rows of X are identical
# 17 (=8+3+6) because the 6th, the 8th and the 9th rows of X are identical