R/update-methods.R

##
## Methods for updating an existing object
## =======================================
##
## Method definition for objects of class "NeosOff"
##
setMethod("update", signature(object = "NeosOff"), function(object, formula.,..., evaluate = TRUE){
  call <- object@CALL
  extras <- match.call(expand.dots = FALSE)$...
  if (length(extras) > 0) {
    existing <- !is.na(match(names(extras), names(call)))
    for (a in names(extras)[existing]) call[[a]] <- extras[[a]]
    if (any(!existing)) {
      call <- c(as.list(call), extras[!existing])
      call <- as.call(call)
    }
  }
  if (evaluate)
    eval(call, parent.frame())
  else call
})

Try the rneos package in your browser

Any scripts or data that you put into this service are public.

rneos documentation built on April 23, 2020, 9:05 a.m.