R/modifyOptargs.R

Defines functions .optargsRemove .optargsReplace

# Internal functions used to passing and modifying optional arguments
# within functions
# 1. replace must be a list of the form
# list(A = newval)
# 2. remove is a list of variables of the form c("x","y")
# Ariane Schad, Feb 2019

.optargsReplace <- function(..., replace){
    opt.args <- list(...)
    opt.args[[names(replace)]] <- replace[[1]]
    return(opt.args)
}

.optargsRemove <- function(..., remove){
    opt.args <- list(...)
    opt.args[remove] <- NULL
    return(opt.args)
}

Try the MBQN package in your browser

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

MBQN documentation built on Nov. 8, 2020, 8:13 p.m.