View source: R/covcor_design.R
covcor_design | R Documentation |
Compute variance-covariance and correlation matrices using data from a designed (RCBD or CRD) experiment.
covcor_design(.data, gen, rep, resp, design = "RCBD", by = NULL, type = NULL)
.data |
The data to be analyzed. It can be a data frame, possible with
grouped data passed from |
gen |
The name of the column that contains the levels of the genotypes. |
rep |
The name of the column that contains the levels of the replications/blocks. |
resp |
The response variables. For example |
design |
The experimental design. Must be RCBD or CRD. |
by |
One variable (factor) to compute the function by. It is a shortcut
to |
type |
What the matrices should return? Set to |
An object of class covcor_design
containing the following
items:
geno_cov The genotypic covariance.
phen_cov The phenotypic covariance.
resi_cov The residual covariance.
geno_cor The phenotypic correlation.
phen_cor The phenotypic correlation.
resi_cor The residual correlation.
If .data
is a grouped data passed from dplyr::group_by()
then the results will be returned into a list-column of data frames.
Tiago Olivoto tiagoolivoto@gmail.com
library(metan) # List of matrices data <- subset(data_ge2, ENV == 'A1') matrices <- covcor_design(data, gen = GEN, rep = REP, resp = c(PH, EH, NKE, TKW)) # Genetic correlations gcor <- covcor_design(data, gen = GEN, rep = REP, resp = c(PH, EH, NKE, TKW), type = 'gcor') # Residual (co)variance matrix for each environment rcov <- covcor_design(data_ge2, gen = GEN, rep = REP, resp = c(PH, EH, CD, CL), by = ENV, type = "rcov")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.