From: <li...@us...> - 2011-12-30 15:56:43
|
Revision: 231 http://bugs-r.svn.sourceforge.net/bugs-r/?rev=231&view=rev Author: ligges Date: 2011-12-30 15:56:37 +0000 (Fri, 30 Dec 2011) Log Message: ----------- minor improvements / tidy up Modified Paths: -------------- trunk/BRugs/R/internal.R Modified: trunk/BRugs/R/internal.R =================================================================== --- trunk/BRugs/R/internal.R 2011-12-30 15:55:52 UTC (rev 230) +++ trunk/BRugs/R/internal.R 2011-12-30 15:56:37 UTC (rev 231) @@ -50,8 +50,7 @@ trashDir <- paste(tempDir, "_trash", sep="") extFile <- getOption("BRugsExtFile") cmdFile <- paste(tempDir, "cmds.txt", sep="/") - pkgPath <- searchpaths()[search()=="package:BRugs"] - bugsPath <- paste(pkgPath, "/exec/BugsHelper", sep="") + bugsPath <- system.file("exec", "BugsHelper", package="BRugs") shcmd <- paste(dquote(bugsPath), dquote(tempDir), dquote(trashDir), dquote(extFile), dquote(cmdFile), dquote(ncmds)) for (i in 1:ncmds) { if (cmdtypes[i] %in% c("CharArray","RealArray")) @@ -62,7 +61,7 @@ res <- system(shcmd) handleRes(res) out <- vector(ncmds, mode="list") - for (i in 1:ncmds) { + for (i in seq_along(cmds)){ if (cmdtypes[i] %in% c("Integer","CharArray","RealArray")) out[[i]] <- scan(paste(tempDir,"/output",i,".txt",sep=""), switch(cmdtypes[i], @@ -76,7 +75,7 @@ handleRes <- function(res) { - maintainer <- utils:::packageDescription("BRugs", fields="Maintainer") + maintainer <- maintainer("BRugs") errors <- c("Internal \"trap\" error in OpenBUGS, or non-existent module or procedure called.", "An OpenBUGS procedure was called with the wrong type of argument.", "An OpenBUGS procedure was called with the wrong signature.") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |