Problem with "bnlearn" package & string elements table by reading with excel (or readxl...)

Any way you can supply a limited reproducible example, reprex with small example files?

It sounds like you have two questions. One loading data as an excel file. And one understanding the error message bnlearn gives you.

With the read.csv call, are you familiar with the stringsAsFactors setting? (some fun background). The readr package's read_csv had string variables as character types.

For the bnlearn error message. I'm not too familiar with this package, but I think variables must be either numeric, factors or ordered factors (bnlearn-manual), and depending on what you're doing you might be further limited.

I have a feeling the data-loading issue will be a quick solve here once you give a reprex. But for the bnlearn question you might change the category to #ml, machine learning and modeling.

1 Like