Complex Argument Matching

Allows for highly flexible and generic function argument matching.


ParmOff (R package)

R-CMD-check

Synopsis

Core package providing a simple interface to allow highly flexible and generic function argument matching. Allows users to pass complex lists of arguments into functions, with matching and mis-matching rules.

Installation

Getting ParmOff

Source installation from GitHub should be easy:

install.packages('remotes')
remotes::install_github("asgr/ParmOff")
library(ParmOff)

Code Example

# Pass a mixture of an argument list and dots, ignoring conflicting arguments from latter:
example_args = list(col='red', xlab='Test x', ylab='Test y')
ParmOff(plot, example_args, x=sin, xlab='Ignore This')

# Ignore the col argument (if present, which it is):
ParmOff(plot, example_args, .rem_args='col', x=sin, xlab='Ignore This')

# An example of a complex model (note for non complex .args you can use a named vector):
model_ex = function(x, y, z){x * y + z}
input = c(x=1, y=2, z=3, t=4) # the input to pass into .args (note 't' will be ignored)
ParmOff(model_ex, input)

To find more examples, please check the documentation provided. You can browse these with:

?ParmOff

Contributors

Aaron Robotham

License

LGPL-3+

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ParmOff")

1.0.2 by Aaron Robotham, 5 months ago


Browse source code at https://github.com/cran/ParmOff


Authors: Aaron Robotham [aut, cre]


Documentation:   PDF Manual  


LGPL-3 license


Imports checkmate

Suggests testthat, knitr, rmarkdown, magicaxis


See at CRAN