Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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 seealso section for other methods defined by mrgsolve that have their own documentation pages.

Usage

## S4 method for signature 'mrgsims'
x$name

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

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

## S4 method for signature 'mrgsims'
dim(x)

## S4 method for signature 'mrgsims'
names(x)

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

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

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

## S4 method for signature '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 ...)

  • $ selects a column in the simulated data and returns numeric

  • head see head.matrix; returns simulated data

  • tail see tail.matrix; returns simulated data

  • dim, nrow, ncol returns dimensions, number of rows, and number of columns in simulated data

  • as.data.frame coerces simulated data to data.frame and returns the data.frame

  • as.matrix returns matrix of simulated data

  • summary coerces simulated data to data.frame and passes to summary.data.frame

  • plot plots simulated data; see plot_mrgsims

See Also

Examples

## example("mrgsims")

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

out <- mrgsim(mod)

class(out)

## Not run: 
out

## End(Not run)
head(out)
tail(out)


dim(out)
names(out)

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

## Not run: 
out$CP

## End(Not run)

plot(out)
## Not run: 
plot(out, CP~.)
plot(out, CP+RESP~time, scales="same", xlab="Time", main="Model sims")

## End(Not run)

mrgsolve

Simulate from ODE-Based Models

v0.11.1
GPL (>= 2)
Authors
Kyle T Baron [aut, cre] (<https://orcid.org/0000-0001-7252-5656>), Bill Gillespie [ctb], Charles Margossian [ctb], Devin Pastoor [ctb], Bill Denney [ctb] (<https://orcid.org/0000-0002-5759-428X>), Dilawar Singh [ctb], Felicien Le Louedec [ctb] (<https://orcid.org/0000-0003-3699-2729>), Timothy Waterhouse [ctb] (<https://orcid.org/0000-0002-0954-9660>), Metrum Research Group [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.