I have this code here:
tan = tree.bayes(Data, "outcome") fitted = bn.fit(tan, Data, method = "bayes") jtree = compile(as.grain(fitted)) #produces an error below
The error produced is:
Warning: Error in : 'grain.CPTspec' is not an exported object from 'namespace:gRain' 81: stop 80: getExportedValue 79: :: 78: as.grain.bn.fit 76: bnFunction [C:/Users/Core.R#598] 72: observeEventHandler [C:/Users/AppInterface.R#467] 1: runApp
I printed the fitted object and it looks just fine.
R version 3.6.2 (2019-12-12)
bnclassify_0.4.4 / gRain_1.3-3 / gRbase_1.8-5.1 / bnlearn_4.5
Any help on this will be much appreciated!