View source: R/map_utilities.R
get_network_structure | R Documentation |
Create a Bayesian network graph
get_network_structure(maplist, nodes, obs, nonlinear_ind = TRUE)
maplist |
A list of mapping objects |
nodes |
A vector with the node name associated to the variables. Several variables can belong to the same node. |
obs |
A vector of observed values. Unobserved values are represented by
|
nonlinear_ind |
Should non-linear interactions between nodes be indicated by dashed lines. |
Return an igraph graph object
## Not run: library(igraph) params1 <- list( mapname = "mylinearmap1", maptype = "linearinterpol_map", src_idx = 1:3, tar_idx = 4:6, src_x = c(1,5,10), tar_x = c(4,5,6) ) params2 <- list( mapname = "mylinearmap2", maptype = "linearinterpol_map", src_idx = 4:6, tar_idx = 7:9, src_x = c(4,5,7), tar_x = c(4.5, 5, 5.5) ) compparams <- list( mapname = "mycompmap", maptype = "compound_map", maps = list(params1, params2) ) mymap1 <- create_map(params1) mymap2 <- create_map(params2) mymap <- create_map(compparams) maplist <- mymap$getMaps() nodes <- c(rep("mynode1", 3), rep("mynode2", 3), rep("obsnode", 3)) obs <- rep(NA, 9) grph <- get_network_structure(maplist, nodes, obs) plot(grph) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.