R-Forge Logo

The RHugin Package Homepage

The Hugin Decision Engine (HDE) is commercial software produced by HUGIN EXPERT A/S for building and making inference from Bayesian belief networks. The RHugin package provides a suite of functions allowing the HDE to be controlled from within the R environment for statistical computing. The RHugin package can thus be used to build Bayesian belief networks, enter and propagate evidence, and to retrieve beliefs. Additionally, the RHugin package can read and write hkb and NET files, making it easy to work simultaneously with both the RHugin package and the Hugin GUI. A licensed copy of the HDE (or the trial version) is required for the RHugin package to function, hence the target audience for the package is Hugin users who would like to take advantage of the statistical and programatic capabilities of R.

Please note that the RHugin package is not supported by Hugin Expert A/S.

Code and development statistics for the RHugin project are available on the summary page.

News

Installation

If you do not have Hugin installed in the default location, you will need to set the HUGINHOME environment variable in order to use the RHugin package (see the Hugin API Reference Manual). Also, you will need to modify the HUGINHOME variable in the installation instructions below.

Dependencies

The RHugin package depends on the graph and gRbase packages. In R, run the commands

  source("http://bioconductor.org/biocLite.R")
  biocLite("graph")

to install the graph package from Bioconductor and the command

  install.packages("gRbase")

to install the gRbase package from CRAN. The graph package should be installed first since it is also needed by the gRbase package and is not available from CRAN.

Installing the RHugin Package on Linux

Linux users can install the package using the install.packages function in R.

  Sys.setenv(HUGINHOME = "/usr/local/hugin")
  install.packages("RHugin", repos = "http://R-Forge.R-project.org")

Installing the RHugin Package on Mac OS X

Mac OS X users can install the package using the install.packages function as well. The HUGINHOME environment variable must be set to the full path of the Hugin Decision Engine folder. In most cases typing Sys.setenv(HUGINHOME = "/Applications/HDE then pressing tab will give the correct path. The following commands install the package for Hugin Lite.

  Sys.setenv(HUGINHOME = "/Applications/HDE7.5-lite")
  install.packages("RHugin", repos = "http://R-Forge.R-project.org", type = "source")

As of version 0.7-12, the RHugin package dynamically links to the Hugin Decision Engine hence Hugin 7.2 or later is required.

Installing the RHugin Package on Microsoft Windows

Binary packages for Windows.

Download the package corresponding to your version of Hugin then use the "Install package(s) from local zip files..." item from the R Packages menu to install the package.

Optional: Rgraphviz

RHugin uses the Rgraphviz package to plot Hugin domains and to position nodes in hkb and NET files.

Microsoft Windows

The Rgraphviz package is quite sensitive to the specific versions of Graphviz and R installed on the computer. The binary package provided here was built using Graphviz 2.28.0 and R 2.13.x and has been tested on Windows XP, Vista, and 7.

  1. Download and install Graphviz 2.28.0.

  2. Add the full path to the Graphviz bin folder (e.g., C:\Program Files (x86)\Graphviz 2.28\bin) to the Windows Path Environment Variable.

  3. Download the Rgraphviz binary package and install it using the "Install package(s) from local zip files..." item from the R Packages menu.

Mac OS X

The Rgraphviz package has an external dependency on Graphviz (http://www.graphviz.org), so you need to install Graphviz on your computer before installing the Rgraphviz package. You can download the latest version of Graphviz for Max OS X from the following link.

     http://www.graphviz.org/Download_macos.php

Note that snowleopard refers to Mac OS X version 10.6 and leopard refers to Mac OS X version 10.5. Older versions of Mac OS X (e.g., Tiger) are not supported by Graphviz. You can find your Mac OS X version by clicking on the Apple menu and selecting About This Mac. Graphviz is distributed as a package for Mac OS X's Installer.app. Double click the downloaded file and follow the instructions to install the software.

Once Graphviz has been installed, run the following commands in R to build and install the Rgraphviz package.

  source("http://bioconductor.org/biocLite.R")
  biocLite("Rgraphviz", type = "source")

Note: if you do not have the developer tools installed, you can omit the type argument to install the binary version of the Rgraphviz package. The binary package is built for a specific version of Graphviz and if that version does not match the version on your computer, it may cause problems (although I haven't noticed any yet).

Linux and other *nix

Graphviz must be installed on the computer in order for the Rgraphviz package to work. Graphviz can be obtained from the Graphviz website. Once Graphviz has been installed, follow the Bioconductor instructions to install Rgraphviz.