docomp | R Documentation |
Do computations for several traits for some specific factors.
docomp(do, traits, factors, keep = NULL, dfr, method = c("fast", "slow"))
do |
The computation to perform. Implemented options are |
traits |
List of traits. |
factors |
List of factors. |
keep |
Additional columns to keep. |
dfr |
The name of the data frame. |
method |
Use |
This function do a specific computation for all the traits
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
traits <- c("rytha", "bc", "dm", "star", "nocr")
factors <- c("geno", "loc")
output1 <- docomp("mean", traits, factors, dfr = spg)
docomp("mean", traits, "geno", dfr = output1)
# Compute maxima across replications for each genotype and location.
docomp("max", traits, factors, dfr = spg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.