I was trying to use 'tabu' algorithm in bnlearn package in r to draw the Bayesian network. I have a data frame contains large data set and all of the columns are numeric type. I am getting the following error:
Error in if (abs(x1 - x2) < sqrt(.Machine$double.eps)) return(0) else return(x1 - :
missing value where TRUE/FALSE needed
I don't have any missing vales in my data set.
Here is my attempt:
data = data.frame(data)
res=tabu(data)
graphviz.plot(res)
Thanks in advance.
The error was due to a bug in
tabu, inbnlearnversions <= 4.8.1, in how constant, or latent, variables were treated.The package author has released an update which can be installed from the
bnlearnwebsiteNow the following example should run without the error observed in the OP