Page 1 of 1

BN Learn Error

PostPosted: Wed Jun 14, 2023 2:30 pm
by rpazo001
Here is the error I keep getting. The data = RATBN and the network is BN13a. Compile comes from the "gRain" package.


library("tidyverse")
library("bnlearn")
library("gRain")

#### Class BN
> class(Bn13a)
[1] "bn"
>
> class(RATBN)
[1] "data.frame"
>
> ### Create Equation
> bn.bayes<-bn.fit(Bn13a,data=RATBN,method="bayes",iss=1)
>
> ### Compile data
> junction <-compile(as.grain(bn.bayes))
Error in str2lang(x) : <text>:1:10: unexpected input
1: ~ 1375689_
^