R/callWithoutArgs.R

Defines functions callWithoutArgs

## strip arguments "args" and call the function with name "fName" thereafter
callWithoutArgs <- function(theta, fName, args, ...) {
   f <- match.call()
   f[ args ] <- NULL
   f[[1]] <- as.name(fName)
   names(f)[2] <- ""
   f[["fName"]] <- NULL
   f[["args"]] <- NULL
   f1 <- eval(f, sys.frame(sys.parent()))
   return( f1 )
}

Try the maxLik package in your browser

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

maxLik documentation built on Nov. 25, 2020, 3 a.m.