Description Usage Arguments Value Author(s) Examples

View source: R/mahala_design.R

Compute the Mahalanobis distance using data from an experiment conducted in a randomized complete block design or completely randomized design.

1 2 3 4 5 6 7 8 9 |

`.data` |
The dataset containing the columns related to Genotypes,
replication/block and response variables, 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 |

`return` |
What the function return? Default is 'distance', i.e., the
Mahalanobis distance. Alternatively, it is possible to return the matrix of
means |

A symmetric matrix with the Mahalanobis' distance. 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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
library(metan)
maha <- mahala_design(data_g,
gen = GEN,
rep = REP,
resp = everything(),
return = "covmat")
# Compute one distance for each environment (all numeric variables)
maha_group <- mahala_design(data_ge,
gen = GEN,
rep = REP,
resp = everything(),
by = ENV)
# Return the variance-covariance matrix of residuals
cov_mat <- mahala_design(data_ge,
gen = GEN,
rep = REP,
resp = c(GY, HM),
return = 'covmat')
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.