dist_env: Environmental distance matrix

Description Usage Arguments Details Value Examples

View source: R/dist_env.R

Description

Calculates the distance between environments based on the observed phenotypes of genotypes shared between environments.

Usage

1
dist_env(x, gen.col = "gen", env.col = "env", pheno.col = "yield")

Arguments

x

A data.frame of phenotypic observations on genotypes in environments. The data.frame should be in tidy format, where every phenotypic observation has a separate row.

gen.col

The column name that contains the names of genotypes.

env.col

The column name that contains the names of environments.

pheno.col

The column name that contains the phenotypic observations.

Details

The distance between environments (D_jj) cannot be less than 0 and cannot exceed 4. A distance close to 0 indicates that the relative performance of genotypes is similar (i.e. the correlation between genotype performance across environments is r_jj = 1) while a distance close to 2 indicates that the correlation between genotype performance is close to r_jj = 0. Finally, as D_jj approaches 4, crossover interactions are abundant and the correlation of genotype performance is close to r_jj = -1.

Value

A dist matrix of distances between environments. This dist object can be used by clustering functions such as hclust.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
data("yang.barley")

# Calculate distance
yang_barley_dist <- dist_env(x = yang.barley, env.col = "site")

# Environment dendrogram
yang_barley_clust <- hclust(yang_barley_dist, method = "average")
plot(yang_barley_clust)

## End(Not run)

neyhartj/pbr documentation built on Jan. 7, 2020, 9:24 a.m.