# require("Rgraphviz")
set.seed(123)
dag1 <- unifDAG(20)
dag2 <- unifDAG.approx(20,15)
dag <- unifDAG(5)
plot(dag)
dag@edgeData ## note the constant weights
dag <- unifDAG(5,weighted=TRUE)
plot(dag)
dag@edgeData ## note the uniform weights between 0.1 and 1
wFUN <- function(m,lB,uB) { runif(m,lB,uB) }
dag <- unifDAG(5,weighted=TRUE,wFUN=list(wFUN,1,4))
dag@edgeData ## note the uniform weights between 1 and 4
Run the code above in your browser using DataLab