as.bn: Convert an object to a bn.

Description Usage Arguments See Also Examples

View source: R/convert.R

Description

A generic function that converts objects to bn objects

Usage

1
  as.bn(x, ...)

Arguments

x

An object

...

Further arguments, passed to method

See Also

as.bn.matrix, as.bn.character, as.bn.graphNEL

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
edgelist <- matrix(c(c(1,2), c(2, 3)), byrow = TRUE, nrow = 2, ncol = 2)
colnames(edgelist) <- c("row", "col")
as.bn(edgelist, type = "edgelist", n = 3)

x <- "[][1][1,2][3]"
as.bn(x, pretty = TRUE)

if (require(graph)){
set.seed(123)
c1 <- c(1, 1, 2, 4)
names(c1) <- as.character(1:4)
g1 <- randomNodeGraph(c1)
as.parental(g1)
}

rjbgoudie/parental documentation built on May 27, 2019, 9:11 a.m.