[da26f9]: R / windows / zzz.R  Maximize  Restore  History

Download this file

30 lines (24 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
.onLoad <- function(lib, pkg)
{
## FIXME - We should user SOFTWARE\JAGS\version in future
regkey <- try(readRegistry("SOFTWARE\\JAGS-1.0.3",
hive = "HLM", maxdepth = 1), silent = TRUE)
if (inherits(regkey, "try-error"))
stop("Failed to locate JAGS 1.0.3 installation")
jags.home <- regkey[["Install_Dir"]]
## Add jags.home to the windows PATH, if not already present
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(bindir, path, sep=.Platform$path.sep)
Sys.setenv("PATH"=path)
}
## Set the module directory, if the option jags.moddir is not already set
if (is.null(getOption("jags.moddir"))) {
options("jags.moddir" = file.path(jags.home, "modules"))
}
jags.module(c("basemod","bugs"))
library.dynam("rjags", pkg, lib, local=FALSE)
.Call("init_jags_console", PACKAGE="rjags")
}

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks