The Nagarajan et al. book (Bayesian Networks in R, O'Reilly 2013, p. 35) says that when I take the marks dataset of the R bnlearn package and ask to learn structure using the grow-shrink implementation by writing
library(bnlearn)
data(marks)
bn.gs = gs(marks)
When I apply
bn.gs = gs(marks)
bn.gs or even bn.hc, it says that:
"Error in matrix(c(x$d, x$pi, x$sigma, x$rho), ncol = 1) : 'data' must be of a vector type, was 'NULL'"
It seems it has problem with my data type, which is exactly the same as book. What can I do?
sessionInfo()to your question please. Also does the problem persist on a new R session? - user20650