Skip to contents

Check connectivity between trials

Usage

check_connectivity(
  data = NULL,
  genotype = "line",
  trial = "Experiment",
  response = NULL,
  all = FALSE,
  return_matrix = FALSE
)

Arguments

data

A data.frame in a wide format.

genotype

A character string indicating the column in data that contains genotypes.

trial

A character string indicating the column in data that contains trials.

response

A character string specifying the trait.

all

Whether or not print all the table.

return_matrix

A logical value indicating if the user wants to return a (n_trial x n_trial) matrix with the amount of genotypes shared between each pair of trial. (FALSE by default)

Value

A data.frame with the genotype connectivity. If return_matrix is TRUE, it will return a n_trial x n_trial matrix with the amount of genotypes shared between each pair of trial.

Examples

library(agridat)
library(agriutilities)
data(besag.met)
dat <- besag.met
head(
  check_connectivity(
    data = dat,
    genotype = "gen",
    trial = "county",
    response = "yield",
    all = TRUE,
    return_matrix = FALSE
  )
)
#>   gen C1 C2 C3 C4 C5 C6 total n percent
#> 1 G01  1  1  1  1  1  1     6 6       1
#> 2 G02  1  1  1  1  1  1     6 6       1
#> 3 G03  1  1  1  1  1  1     6 6       1
#> 4 G04  1  1  1  1  1  1     6 6       1
#> 5 G05  1  1  1  1  1  1     6 6       1
#> 6 G06  1  1  1  1  1  1     6 6       1