Learn R Programming

maxRgain (version 1.1.0)

update.polyresult: Update method for polyclonal results

Description

Allows updating any argument of a previous polyclonal() call without rewriting the full call. Defaults are preserved for arguments not provided.

Usage

# S3 method for polyresult
update(object, ...)

Value

A new polyresult object with updated arguments applied.

Arguments

object

A polyresult object returned by polyclonal().

...

Arguments to update in the original polyclonal() call.

Examples

Run this code
#' Original call

selections <- polyclonal(traits = c("yd", "pa", "ta", "ph", "bw"),
                  clmin = 7, clmax = 15,
                  dmg = "base",
                  meanvec = c(yd = 3.517, pa = 12.760, ta = 4.495, ph = 3.927, bw = 1.653),
                  criteria = c(yd = 1, pa = 1, ta = 1, ph = -1, bw = -1),
                  data = Gouveio)

selections
# Update clmax
selupdate1 <- update(selections, clmax = 10)

selupdate1

# Update dmg
selupdate2 <- update(selupdate1, dmg = data.frame(
                     lhs = c("yd", "pa", "ta", "ph", "bw"),
                     rel = c(">=", ">=", ">=", ">=", ">="),
                     rhs = c(25, 0, 0, 0, 0)
                     )
                   )

selupdate2

Run the code above in your browser using DataLab