R/rbn.R

Defines functions rbn

Documented in rbn

rbn <- function(n, dagobj, x) {
  if ( is.null( colnames(x) ) )  colnames(x) <-  paste("X", 1:dim(x)[2], sep = "")
  if ( !is.data.frame(x) )  x <- as.data.frame(x)
  fitted <- bnlearn::bn.fit(dagobj, data = x)
  bnlearn::rbn(x = fitted, n = n)
}

Try the pchc package in your browser

Any scripts or data that you put into this service are public.

pchc documentation built on April 4, 2025, 1:11 a.m.