Saves the SPATA2 object under a default directory.

saveSpataObject(object, dir = NULL, verbose = NULL, ...)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

dir

Character value. The directory under which to store the SPATA2 object. If NULL, defaults to the directory set with setSpataDir().

verbose

Logical. If TRUE, informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

...

Used to absorb deprecated arguments or functions.

Value

Apart from their side effect (saving the object of interest) all three functions return the provided, updated SPATA2 object.

Examples

library(SPATA2)

data("example_data")

object <- example_data$object_UKF269T_diet

getSpataDir(object) # fails, no directory set

# opt 1
object <- setSpataDir(object, directory_spata = "my_folder/object_UKF269T.RDS")

saveSpataObject(object)

# opt 2
object <- saveSpataObject(object, directory_spata = "my_folder/object_UKF269T.RDS")

getSpataDir(object)