class-utils | R Documentation |
A utility function to set slots to default values if their values are not provided to initialize
methods.
.emptyDefault(args, field, default)
args |
A named list of arguments to pass to the |
field |
String specifying the field to set. |
default |
The default value of the slot in |
A more natural approach would be to have the default values in the arguments of the initialize
method.
However, this would require us to hard-code the slot names in the function signature,
which would break our current DRY model of only specifying the slot names once.
args
is returned with the named field
set to default
if it was previously absent.
Aaron Lun, Kevin Rue-Albrecht
showMethods("initialize", classes = "ReducedDimensionPlot", includeDefs = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.