evaluate | R Documentation |
Evaluate a graph where nodes and edges store functions.
evaluate(g)
g |
ralget |
## Not run:
product <- function(...){list(...) %>% reduce(`*`)}
const <- function(x){function(...){x}}
S01 <- v("S01", .func = const(10000))
I01 <- v("I01", .func = const(10))
BIS01 <- v("BIS01", .func = product)
S02 <- v("S02", .func = sum)
I02 <- v("I02", .func = sum)
SIR <-
S01 * ( e(.func = function(.value){.value * .5} ) * BIS01 +
e(.func = function(.value){.value * 1} ) * S02 ) +
I01 * ( e(.func = function(.value){.value * 1} ) * BIS01 +
e(.func = function(.value){.value * 1}) * I02 ) +
BIS01 * (e(.func = function(.value){.value * 1} ) * S02 +
e(.func = function(.value){.value * -2}) * I02 )
evaluate(SIR)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.