A utility function to set slots to default values if their values are not provided to initialize
methods.
Details
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.
Examples
showMethods("initialize", classes = "ReducedDimensionPlot", includeDefs = TRUE)
#> Function: initialize (package methods)
#> .Object="ReducedDimensionPlot"
#> function (.Object, ...)
#> {
#> args <- list(...)
#> args <- .emptyDefault(args, .redDimType, NA_character_)
#> args <- .emptyDefault(args, .redDimXAxis, 1L)
#> args <- .emptyDefault(args, .redDimYAxis, 2L)
#> do.call(callNextMethod, c(list(.Object), args))
#> }
#>
#>
#>