Learn R Programming

mrgsolve (version 1.5.2)

mrgsims: Methods for working with mrgsims objects

Description

These methods help the user view simulation output and extract simulated data to work with further. The methods listed here for the most part have generics defined by R or other R packages. See the See Also section for other methods defined by mrgsolve that have their own documentation pages.

Usage

# S4 method for mrgsims
$(x, name)

# S4 method for mrgsims tail(x, ...)

# S4 method for mrgsims head(x, ...)

# S4 method for mrgsims dim(x)

# S4 method for mrgsims names(x)

# S4 method for mrgsims as.data.frame(x, row.names = NULL, optional = FALSE, ...)

# S4 method for mrgsims as.matrix(x, ...)

# S3 method for mrgsims summary(object, ...)

# S4 method for mrgsims show(object)

Arguments

x

mrgsims object.

name

name of column of simulated output to retain

...

passed to other functions.

row.names

passed to as.data.frame().

optional

passed to as.data.frame().

object

passed to show.

Details

Most methods should behave as expected according to other method commonly used in R (e.g. head, tail, as.data.frame, etc ...)

See Also

stime()

Examples

Run this code

## example("mrgsims")

mod <- mrgsolve::house() %>% init(GUT=100)

out <- mrgsim(mod)

class(out)

if (FALSE) {
out
}
head(out)
tail(out)


dim(out)
names(out)

mat <- as.matrix(out)
df <- as.data.frame(out)

if (FALSE) {
out$CP
}

plot(out)

if (FALSE) {
plot(out, CP~.)
plot(out, CP+RESP~time, scales="same", xlab="Time", main="Model sims")
}

Run the code above in your browser using DataLab