# NOT RUN {
### Learn the cytometry network
library(sparsebn)
data(cytometryContinuous)
cyto.data <- sparsebnData(cytometryContinuous[["data"]],
type = "continuous",
ivn = cytometryContinuous[["ivn"]])
cyto.learn <- estimate.dag(data = cyto.data)
### The output is a sparsebnPath object, which is a list of sparsebnFit objects
class(cyto.learn)
class(cyto.learn[[1]])
### Convert to igraph
cyto.igraph <- to_igraph(cyto.learn)
class(cyto.igraph) # not an igraph object!
class(cyto.igraph[[1]]$edges) # the graph data in the 'edges' slot is converted to igraph
gr <- cyto.igraph[[1]]$edges
### Different behaviour when input is already an edgeList
edgeL <- cyto.learn[[1]]$edges
gr <- to_igraph(edgeL) # input is edgeList, not sparsebnFit or sparsebnPath
class(gr) # igraph object
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab