View source: R/FunctionParameterTypeFactory.R
FunctionParameterTypeFactory | R Documentation |
This factory is a parameter type check factory. It provides type checking for each allowed type.
FunctionParameterTypeFactory()
Many common types are already recorded and available through the factory. Use the function
getRecordedTypes
to get more insight.
If you desire to verify a type instrumentation, just use checkSuffix
function.
If you want to add an instrumentation for a new type, use addSuffix
function.
See examples below for more hands-on approach.
An object
that is an R environment
.
Fabien Gelineau <neonira@gmail.com>
Maintainer: Fabien Gelineau <neonira@gmail.com>
Refer to defineEvaluationModes
##---- typical case ----
ff <- FunctionParameterTypeFactory()
ff$checkSuffix('b') # TRUE
# see verify_function recorded for 'boolean' entries
ff$getRecordedTypes()[suffix == 'b']$verify_function[[1]]
# record a new entry for suffix 'wo'
ff$addSuffix('wo', "wo class", function(o_) is(o, "wo")) # TRUE
ff$getRecordedTypes()[suffix == 'wo']
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.