simcausal
simcausal copied to clipboard
using as.integer() in node formulas prints to the terminal:
using as.integer() in node formulas prints it to the terminal:
library(simcausal)
D <- DAG.empty()
D <- D +
node("Trexp", distr = "rexp", rate = 1) +
node("Cweib", distr = "rweibull", shape = 0.5, scale = 1) +
node("T", distr = "rconst", const = as.integer(Trexp*100))
setD <- set.DAG(D)
dat <- sim(setD, n=100)