docomp | R Documentation |
Do computations for several variables for some specific factors.
docomp(do, vars, factors, keep = NULL, dfr, method = c("fast", "slow"))
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. |
dfr |
The name of the data frame. |
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("mean", vars, factors, dfr = spg)
docomp("mean", vars, "geno", dfr = output1)
# Compute maxima across replications for each genotype and location.
docomp("max", vars, factors, dfr = spg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.