View source: R/retrieveFactory.R
retrieveFactory | R Documentation |
As factory may be modified, this function allows you to make changes and to record them in your own specialized type factory, to match various needs and ease reuse.
retrieveFactory()
Retrieves a FunctionParameterTypeFactory
from options variable named
op_type_factory
or provides a default type factory.
An R object
that is a FunctionParameterTypeFactory
.
Fabien Gelineau <neonira@gmail.com>
Maintainer: Fabien Gelineau <neonira@gmail.com>
##---- typical case ----
ff <- retrieveFactory()
ff$addSuffix('wo', "wo class", function(o_) is(o_, "wo"))
ff$addSuffix('yo', "yo class", function(o_) is(o_, "yo"))
ff$addSuffix('zo', "zo class", function(o_) is(o_, "zo"))
options('op_type_factory' = ff)
fg <- retrieveFactory() # retrieves the factory pointed by R variable ff
fg$getRecordedTypes()[suffix %in% c('wo', 'yo', 'zo')] # right behavior !
# wrong behavior as retrieveFactory will provide the default factory and not yours!
options('op_type_factory' = ff)
fh <- retrieveFactory() # retrieves the default factory
fh$getRecordedTypes()[suffix %in% c('wo', 'yo', 'zo')]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.