eventlist: Eventlist

View source: R/eventClass.R

eventlistR Documentation

Eventlist

Description

An eventlist is a data.frame with the necessary parameters to define an event as columns and specific events as rows. Event time and value can be passed as parameters, which can also be estimated.

Usage

eventlist(var = NULL, time = NULL, value = NULL, root = NULL, method = NULL)

addEvent(event, var, time = 0, value = 0, root = NA, method = "replace", ...)

Arguments

var

Character, the state to which the event is applied

time

Character or Numeric, the time at which the event happens

value

Character or Numeric, the value of the event

root

Character or NA, condition to trigger the event instead of time

method

Character, options are "replace", "add" or "multiply"

event

object of class eventlist

...

not used

Details

The function addEvent is pipe-friendly

Value

data.frame with class eventlist

Examples

eventlist(var = "A", time = "5", value = 1, method = "add")

events <- addEvent(NULL, var = "A", time = "5", value = 1, method = "add")
events <- addEvent(events, var = "A", time = "10", value = 1, method = "add")

# With symbols
events <- eventlist()
# Set "A" to "value_switch" at time "time_Switch"
events <- addEvent(events, var = "A", time = "time_switch", value = "value_switch", method = "replace")
# Set "B" to 2 when "A" reaches "A_target". The time-parameter for internal use will be "time_root".
events <- addEvent(events, var = "B", time = "time_root", value = 2, root = "A - A_target", method = "replace")

dkaschek/dMod documentation built on April 23, 2024, 5:18 p.m.