R/grain.r

## #' @title Coerce model object to Bayesian netowork
## #'
## #' @param x A `dmod` object
## #'
## #'
## #' @examples
## #'
## #' fm <- dmod(~.^., data=lizard) |> stepwise()
## #' fm |> formula()
## #' bn <- as.grain(fm)
## #' bn
## #' 
## #' @export
## as.grain <- function(x){
##     UseMethod("as.grain")
## }

## #' @export
## as.grain.dModel <- function(x){
##   uu <- ug(terms(x))
##   out <- gRain::grain(uu, data=x$datainfo$data)  
##   return(out)  
## }

Try the gRim package in your browser

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

gRim documentation built on Oct. 16, 2024, 1:07 a.m.