Learn R Programming

rjags (version 4-18)

jags.module: Dynamically load JAGS modules

Description

A JAGS module is a dynamically loaded library that extends the functionality of JAGS. These functions load and unload JAGS modules and show the names of the currently loaded modules. The load.pkg.module function is provided specifically for use from other R packages containing JAGS modules and checks for binary compatibility between rjags and the indicated package (given by the name argument) before loading the module embedded within the package. Note that this would normally be done in the .onAttach function.

Usage

load.module(name, path, quiet=FALSE)
load.pkg.module(pkgname, libname, bin.compat, quiet=FALSE,
  check.only=FALSE)
unload.module(name, quiet=FALSE)
list.modules()

Arguments

name

name of the module to be loaded

path

file path to the location of the DLL. If omitted, the option jags.moddir is used to locate the modules

quiet

a logical. If TRUE, no message will be printed about loading the module

pkgname

name of the R package containing the module to be loaded

libname

path to the library directory where the R package can be found

bin.compat

a list generated by pkg.compile.flags at build time by the package containing the JAGS module to be loaded

check.only

a logical. If TRUE, binary compatibility checks will be performed but the module will not be loaded (and the package named by pkgname need not exist). This is useful for testing purposes.

Author

Martyn Plummer

Examples

Run this code
list.modules()
load.module("glm")
list.modules()
unload.module("glm")
list.modules()

Run the code above in your browser using DataLab