setDefault | R Documentation |
Sets object specific default for recurring arguments
such as pt_alpha
, pt_clrp
, verbose
.
setDefault(object, ...)
object |
An object of class |
... |
Named arguments whose default input you want to override. |
The updated input object, containing the added, removed or computed results.
library(SPATA2)
object1 <- loadExampleObject("UKFT269T", meta = TRUE)
object2 <- loadExmapleObject("UKF275T", meta = TRUE)
# current
getDefault(object1, arg = "pt_clrp")
getDefault(object2, arg = "pt_clrp")
# if not specified, the function uses the object specific default
plotSurface(object1, color_by = "bayes_space")
plotSurface(object2, color_by = "bayes_space")
# overwrite
object1 <- setDefault(object1, pt_clrp = "uc")
objct2 <- setDefault(object2, pt_clrp = "jco")
# if not specified, the function uses the object specific default
# default has changed
plotSurface(object1, color_by = "bayes_space")
plotSurface(object2, color_by = "bayes_space")
# manually speciyfing the argument overwrites the default
plotSurface(object1, color_by = "bayes_space", pt_clrp = "jama")
plotSurface(object2, color_by = "bayes_space", pt_clrp = "tab20")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.