R/bn.to.igraph.R

Defines functions bn.to.igraph

Documented in bn.to.igraph

#' @title Bayesian Network to iGraph Model
#'
#' @description Converts Bayesian network structure based on package "bnlearn"
#' and "bnviewer" to model based on package "igraph".
#'
#' @param bayesian.network  Bayesian Network structure.
#'
#' @references See online documentation \url{http://robsonfernandes.net/bnviewer}
#'
#' @import igraph
#'
#' @export
#'
#'
#'

bn.to.igraph <- function(bayesian.network){

  g <- igraph.from.graphNEL(bnlearn::as.graphNEL(bayesian.network))
  return(g)
}

Try the bnviewer package in your browser

Any scripts or data that you put into this service are public.

bnviewer documentation built on Jan. 13, 2021, 5:10 p.m.