Closed duducrail closed 1 year ago
Do you have a reproducible example? The code below works fine for me:
library('bnlearn')
df <- data.frame(
a = rnorm(100),
b = rnorm(100)
)
df$c <- df$a + df$b + rnorm(100)
boot<-boot.strength(df, R=10000, algorithm = 'iamb')
library("qgraph")
qgraph(boot)
Hi Sacha, thanks for the fast reply. I tried the exactly same code as you put above and got the same error. I think it's on my side. I did install/update some packages that I can't remember. And after doing this I got the error.
Maybe I'll try to reinstall R and qgraph all over again? Do you think it might work?
What do you get when you run this?
packageVersion("bnlearn")
packageVersion("qgraph")
find("qgraph")
Hi Sacha, I re-install before seeing your message. When I did that it solved the issue. Thank you.
Hello again, this is what appears:
packageVersion("bnlearn") [1] ‘4.8.1’ packageVersion("qgraph") [1] ‘1.9.3’ find("qgraph") [1] "package:gRbase" "package:qgraph"
I wanted to use querygrain, and after installed gRain, gRbase, Rgraphviz, I got the same issue I had before I re-install all over again.
Hi, sorry for the late reply on this. I see the problem now, the gRbase package also exports a function called qgraph
, and so if you load the gRbase
package after you load qgraph
the qgraph(...)
function will no longer work. You can explicitely call qgraph(...)
from the qgraph
package with qgraph::qgraph(...)
. So this should work:
library('bnlearn')
df <- data.frame(
a = rnorm(100),
b = rnorm(100)
)
df$c <- df$a + df$b + rnorm(100)
boot<-boot.strength(df, R=10000, algorithm = 'iamb')
library("qgraph")
qgraph::qgraph(boot)
Hi, When I try to plot a my BN I got the message on the title.
boot<-boot.strength(data, R=10000, algorithm = 'iamb') (this part is ok) qgraph(boot) (this line gives the error)
Using Mac, R 3.6.3 qgraph 1.9 gRbase 1.8.6.7