[53ed63]: R / windows / zzz.R Maximize Restore History

Download this file

zzz.R    36 lines (28 with data), 1.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.onLoad <- function(lib, pkg)
{
if (!require("SWinRegistry")) {
stop("On Windows, rjags requires package SWinRegistry from ",
"http://www.omegahat.org")
}
if (is.null(resolveKey("SOFTWARE\\JAGS-1.0.2\\Install_Dir",
top="HKEY_LOCAL_MACHINE")))
{
stop("Failed to locate JAGS 1.0.2 installation")
}
jags.home <- getRegistryValue("SOFTWARE\\JAGS-1.0.2",
"Install_Dir",
top="HKEY_LOCAL_MACHINE")
bindir <- file.path(jags.home, "bin")
path <- Sys.getenv("PATH")
split.path <- strsplit(path, .Platform$path.sep)$PATH
if (!any(split.path == bindir)) {
path <- paste(path, bindir, sep=.Platform$path.sep)
Sys.setenv("PATH"=path)
}
library.dynam("rjags", pkg, lib, local=FALSE)
if (is.null(getOption("jags.moddir"))) {
options("jags.moddir" = file.path(jags.home, "modules"))
}
jags.module(c("basemod","bugs"))
.Call("init_jags_console", PACKAGE="rjags")
}