eventlist | R Documentation |
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.
eventlist(var = NULL, time = NULL, value = NULL, root = NULL, method = NULL)
addEvent(event, var, time = 0, value = 0, root = NA, method = "replace", ...)
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 |
... |
not used |
The function addEvent
is pipe-friendly
data.frame with class eventlist
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.