rmaxp: Maximum possible gain

View source: R/Rmax.R

rmaxpR Documentation

Maximum possible gain

Description

The maximum possible is the mean of the EBLUPs of the genotypic effects of the best n clones in a given trait, as a percentage of the overall mean. This function calculates the maximum possible gain achieved in the specified traits.

Usage

rmaxp(
  traits,
  ref = NULL,
  clmin = 2,
  clmax,
  meanvec = NULL,
  criteria = NULL,
  data
)

Arguments

traits

A vector with the names of the columns in the data corresponding to the target traits to be optimized, i.e., those included in the objective function.

ref

Name of the reference column (e.g., genotype ID). Defaults to the first column.

clmin

An integer specifying the minimum group size. If omitted, equal to 2.

clmax

An integer specifying the maximum group size. If omitted, equal to clmin.

meanvec

A named numeric vector of trait means; if omitted, data are assumed to be already normalized by the mean.

criteria

A named numeric vector indicating the selection criterion for each trait: 1 for traits to be increased, -1 for traits to be decreased. If omitted, all traits are assumed to be selected for increase.

data

A data frame comprising the input data consisting of the Predictors of genetic effects, which serve as the basis for the selection procedure.

Value

A list with the following components:

  • gain with the gains of the several traits in each dimension

  • selected with the reference of the clones selected in the group of each dimension

Note

The order of the traits must be consistent across traits, meanvec, and criteria.

References

Surgy, S., Cadima, J. & Gonçalves, E. Integer programming as a powerful tool for polyclonal selection in ancient grapevine varieties. Theor Appl Genet 138, 122 (2025). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s00122-025-04885-0")}

Examples

mymeanvec <- c(pa = 12.760)
mytraits <- c("pa")
maxpos <- rmaxp(
   traits = mytraits,
   clmin = 7,
   clmax = 20,
   meanvec = mymeanvec,
   data = Gouveio
   )
maxpos

maxRgain documentation built on Aug. 18, 2025, 5:28 p.m.