View source: R/states_define.R
define_state_list | R Documentation |
Define the states of a Markov model by combining
state
and state_transition
objects.
define_state_list(...)
define_state_list_(.dots)
## S3 method for class 'uneval_state_list'
modify(.OBJECT, ...)
## S3 method for class 'uneval_state_transition_list'
modify(.OBJECT, ...)
... |
Name-value pairs of expressions defining model states and state transtiions. |
.dots |
List of states, only used by
|
.OBJECT |
An |
State names have to correspond to those specified through
define_transition()
. State transitions do not need to
be named.
All states should have the same value names.
The modify
function can modify existing states and state
transitions or add new ones.
An object of class uneval_state_list
(a
list of state
objects).
## Not run:
s1 <- define_state(cost = 1, util = 1)
s2 <- define_state(cost = 3, util = .4)
states_mod <- define_state_list(
healthy = s1,
sick = s2
)
states_mod
s1_bis <- define_state(cost = 0, util = 1)
s3 <- define_state(cost = 10, util = .1)
modify(
states_mod,
healthy = s1_bis,
sicker = s3
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.