R-Forge Logo

The RHugin Package Homepage

The RHugin package provides a platform for building and making inference from Bayesian belief networks by integrating the Hugin Decision Engine into the R environment for statistical computing. The Hugin Decision Engine is commercial software and is required in order to use the RHugin package. Information about Hugin is available from the Hugin website: www.hugin.com. Since a Hugin license is required, the target audience for this package is Hugin users who would like to integrate the statistical and programatic capabilities of R into their Hugin workflow. For those interested in evaluating Hugin, a trial version of Hugin called Hugin Lite is available.

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 your Hugin installation is in a non-standard location, you must set the HUGINHOME environment variable in order to use the 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. These two packages (and their dependencies) are available on CRAN. Run the command

    install.packages(c("graph", "gRbase"))

in R to install them before installing the RHugin package.

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.2-lite")
    install.packages("RHugin", repos = "http://R-Forge.R-project.org", type = "source")

Note that, 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

A binary package is provided for Windows.

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

Only certain versions of Graphviz are compatible with the Rgraphviz package. On Windows XP, Graphviz 2.20.3a seems to work consistently (I only have XP so can not test Vista and Windows 7).

  1. Download and install Graphviz 2.20.3a.

  2. Add the full path to the Graphviz bin folder (e.g., C:\Program Files\Graphviz2.20\bin) to the Windows PATH Environment Variable.

  3. Start R.

  4. Install the Rgraphviz package using the biocLite function.
          source("http://bioconductor.org/biocLite.R")
          biocLite("Rgraphviz")
        

Mac OS X

The Rgraphviz package has an external dependency on Graphviz (http://www.graphviz.org) hence you need to install Graphviz on your computer before attempting to install 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 command in R to build and install the Rgraphviz package.

  install.packages("Rgraphviz", repos = "http://www.bioconductor.org", type = "source")

It is also possible to install Rgraphviz using Bioconductor's biocLite function which will install a binary 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.

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.