library(simDAG)
# simple example adjacency matrix
mat <- matrix(c(0, 0, 1, 0, 0, 1, 0, 0, 0), ncol=3, byrow=TRUE)
colnames(mat) <- c("age", "sex", "death")
rownames(mat) <- c("age", "sex", "death")
type <- list(age="rnorm", sex="rbernoulli", death="binomial")
matrix2dag(mat=mat, type=type)
Run the code above in your browser using DataLab