as.simObj: Coerce simObj Objects to Lists and Vice-Versa

Description Usage Arguments Details See Also Examples

Description

These functions can be used to coerce (i.e. convert) simecol model objects (simObj objects) to ordinary lists.

Usage

1
2
3
4
5
6
7
## S4 method for signature 'list'
as.simObj(x, ...)
## S4 method for signature 'simObj'
as.list(x, ...)
## alternative usage:
# as(x, "list")
# as(x, "simObj")

Arguments

x

object to be coerced

...

for compatibility

Details

Function as.list converts a simObj model to an ordinary list with an additional element 'class' storing the class name of the original object.

Function as.simObj converts in the opposite direction where the type of the object to be created is determined by a class name stored in the list element 'class'. If it is missing or contains a non-existing class name, an error message is printed. Additional list elements which are not slot names of the corresponding S4 object are omitted.

See Also

odeModel, new, as, as.list, simecol-package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(lv3)
llv3 <- as(lv3, "list")
olv3 <- as(llv3, "simObj")

llv3 <- as.list(lv3)
olv3 <- as.simObj(llv3)

dput(as.list(lv3), control="useSource")
## Not run: 
## save human readable object representation
dput(as.list(lv3), file="lv3.R", control=c("all"))
## read it back and test it
l_lv3 <- dget("lv3.R")
o_lv3 <- as.simObj(l_lv3)
plot(sim(o_lv3))

## End(Not run)

simecol documentation built on Nov. 17, 2017, 6:45 a.m.