我在并行使用 R 包bnlearn
和sna
. 下面的例子很简单:
library(bnlearn)
data("asia")
# build network
a <- hc(asia)
# output
a
输出如预期:
Bayesian network learned via Score-based methods
model:
[A][S][T][L|S][B|S][E|T:L][X|E][D|B:E]
nodes: 8
arcs: 7
undirected arcs: 0
directed arcs: 7
average markov blanket size: 2.25
average neighbourhood size: 1.75
average branching factor: 0.88
learning algorithm: Hill-Climbing
score: BIC (disc.)
penalization coefficient: 4.258597
tests used in the learning procedure: 77
optimized: TRUE
加载sna
包后,我会收到完全不同的东西:
library(sna)
#output
a
我得到:
Biased Net Model
Parameters:
Error in matrix(c(x$d, x$pi, x$sigma, x$rho), ncol = 1) :
'data' must be of a vector type, was 'NULL'
因为我并没有真正调用任何函数(只是想获得 的输出a
),所以我认为使用::
运算符没有帮助。
我想知道问题是否是掩盖了我无法真正影响的内部功能。任何帮助都会很棒!