docomp | R Documentation |
Do computations for several variables for some specific factors.
docomp(dfr, do, vars, factors, keep = NULL, method = c("fast", "slow"))
dfr |
The name of the data frame. |
do |
The computation to perform. Implemented options are |
vars |
The names of the columns for the variables. |
factors |
The names of the columns for the factors. |
keep |
The names of additional columns to keep. |
method |
Use |
This function do a specific computation for all the vars
for each level's combination of the factors
. Additional columns can be
kept if specified in keep
. All factors
and keep
values
are converted to character. do = "count"
counts the number
of valid cases (excluding missing values).
It returns a data frame with the computations.
Raul Eyzaguirre.
# Compute means across replications and then across locations for each genotype
vars <- c("rytha", "bc", "dm", "star", "nocr")
factors <- c("geno", "loc")
output1 <- docomp(spg, "mean", vars, factors)
docomp("mean", vars, "geno", dfr = output1)
# Compute maxima across replications for each genotype and location.
docomp(spg, "max", vars, factors)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.