I am using the bnlearn package to learn a network here the code below is showing the output in R Studio software. I am getting the error that the variable must have two or than two levels whereas all my variables are having levels more than two

> Settle1[,sapply(Settle1, nlevels) >1 ]

# A tibble: 98 × 6

Type StQ Conc ComC ComT ClmEnd

1 1 No 3 1 1 1

2 1 Yes 3 1 1 0

3 1 No 2 1 1 1

4 1 Yes 3 1 1 0

5 1 No 4 1 1 1

6 1 Yes 3 1 1 0

7 2 Yes 4 0 0 0

8 1 Yes 4 1 1 0

9 1 Yes 3 1 1 0

10 1 Yes 4 1 1 1

# ... with 88 more rows

> summary(Settle1)

Type StQ Conc ComC ComT ClmEnd

1:68 No :16 1: 4 0:20 0:21 0:64

2:27 Yes:82 2: 5 1:78 1:77 1:34

3: 3 3:41

4:40

5: 8

> settle.bn=hc(Settle1)

Error in check.data(x) : variable Type must have at least two levels.

please help me

More Saurav Singla's questions See All
Similar questions and discussions