format-pdmpModel-method: Format a PDMP for pretty printing.

format,pdmpModel-methodR Documentation

Format a PDMP for pretty printing.

Description

Give important information about a pdmpModel in one character string. This method is used internally to generate default filenames or plot titles.

Usage

## S4 method for signature 'pdmpModel'
format(
  x,
  begin = NULL,
  end = NULL,
  short = TRUE,
  slots = c("parms", "init", "times"),
  sep,
  collapse
)

Arguments

x

an object of class pdmpModel or one of its subclasses.

begin

a character string that is pasted at the beginning.

end

a character string that is pasted at the end.

short

logical. If TRUE, a shorter version without space characters will be returned (useful to generate filenames). Defaults to TRUE.

slots

a vector specifying the names of all slots that shall be pasted to the string. ' The default is c("parms", "init", "times"). Supported slots are "descr", "parms", "init", "times" and "discStates".

sep

a character string to separate the names and values of slots that are vectors or lists (e. g. "times" or "parms"). It defaults to "=" if short is TRUE and to " = " if short is FALSE.

collapse

a character string to separate the slots. It defaults to "___" if short is TRUE and to ". " if short is FALSE.

Examples

data("toggleSwitch")
format(toggleSwitch, begin = "ToggleSwitch__", end = ".rda")
format(toggleSwitch, begin = paste0(descr(toggleSwitch), ": "), short=FALSE)
parms(toggleSwitch) <- list()
cat(format(toggleSwitch, short = FALSE, collapse = ".\n",
           slots = c("init", "times", "discStates"),
           begin = "A model without parameters:\n"))


CharlotteJana/pdmpsim documentation built on Oct. 21, 2024, 4:54 p.m.