From: <li...@us...> - 2007-05-20 15:45:37
|
Revision: 20 http://svn.sourceforge.net/bugs-r/?rev=20&view=rev Author: ligges Date: 2007-05-20 08:45:39 -0700 (Sun, 20 May 2007) Log Message: ----------- Reverted some former changes: - Added some tricks (defining no-op-functions) to make codetools calm. - we do depend on coda now and we are importing parts of its Namespace now, in order to make codetools calm (S-PLUS does not like the "::" operator). Modified Paths: -------------- trunk/R2WinBUGS/Changes trunk/R2WinBUGS/DESCRIPTION trunk/R2WinBUGS/NAMESPACE trunk/R2WinBUGS/R/attach.all.R trunk/R2WinBUGS/R/bugs.data.R trunk/R2WinBUGS/R/read.bugs.R Modified: trunk/R2WinBUGS/Changes =================================================================== --- trunk/R2WinBUGS/Changes 2007-05-20 15:42:40 UTC (rev 19) +++ trunk/R2WinBUGS/Changes 2007-05-20 15:45:39 UTC (rev 20) @@ -74,3 +74,7 @@ - Ported to S-PLUS by Insightful Corp. - some fixes for codetools checks +Update 2.1-4 (20 May 2007): +- Depending on coda now (Namespace issues) +- some more fixes for codetools checks +- Vignette has been updated Modified: trunk/R2WinBUGS/DESCRIPTION =================================================================== --- trunk/R2WinBUGS/DESCRIPTION 2007-05-20 15:42:40 UTC (rev 19) +++ trunk/R2WinBUGS/DESCRIPTION 2007-05-20 15:45:39 UTC (rev 20) @@ -1,7 +1,7 @@ Package: R2WinBUGS Title: Running WinBUGS and OpenBUGS from R / S-PLUS -Date: 2007-05-13 -Version: 2.1-3 +Date: 2007-05-20 +Version: 2.1-4 Author: originally written by Andrew Gelman <ge...@st...>; changes and packaged by Sibylle Sturtz <st...@st...> and Uwe Ligges <li...@st...>. @@ -13,8 +13,8 @@ convergence in a table and graph, and save the simulations in arrays for easy access in R / S-PLUS. In S-PLUS, the openbugs functionality and the windows emulation functionality is not yet available. -Depends: R (>= 2.4.0) -Suggests: coda (>= 0.9-0), BRugs (>= 0.3-0) +Depends: R (>= 2.4.0), coda (>= 0.9-0) +Suggests: BRugs (>= 0.3-0) SystemRequirements: WinBUGS 1.4 URL: http://www.stat.columbia.edu/~gelman/bugsR/ Maintainer: Sibylle Sturtz <st...@st...> Modified: trunk/R2WinBUGS/NAMESPACE =================================================================== --- trunk/R2WinBUGS/NAMESPACE 2007-05-20 15:42:40 UTC (rev 19) +++ trunk/R2WinBUGS/NAMESPACE 2007-05-20 15:45:39 UTC (rev 20) @@ -1,3 +1,5 @@ +importFrom(coda, mcmc.list, read.coda) + export(bugs, attach.all, detach.all, @@ -12,3 +14,4 @@ S3method(print, bugs) S3method(plot, bugs) + Modified: trunk/R2WinBUGS/R/attach.all.R =================================================================== --- trunk/R2WinBUGS/R/attach.all.R 2007-05-20 15:42:40 UTC (rev 19) +++ trunk/R2WinBUGS/R/attach.all.R 2007-05-20 15:45:39 UTC (rev 20) @@ -18,6 +18,9 @@ if(overwrite) remove(list=rem, envir=.GlobalEnv) attach(x, name=name) } else { + ## next line is a dirty trick for R'd codetools check in R-2.5.0 + ## (should be removed after codetoold have been improved): + attach.default <- get("attach.default") attach.default(x, name = name) } } Modified: trunk/R2WinBUGS/R/bugs.data.R =================================================================== --- trunk/R2WinBUGS/R/bugs.data.R 2007-05-20 15:42:40 UTC (rev 19) +++ trunk/R2WinBUGS/R/bugs.data.R 2007-05-20 15:45:39 UTC (rev 20) @@ -24,6 +24,15 @@ } +if(is.R()){ + ## need some fake functions for codetools + "writeDatafileS4" <- toSingleS4 <- function(...) + stop("This function is not intended to be called in R!") +} else { + +### The rest of this file is for S-PLUS only... + + "writeDatafileS4" <- # # Writes to file "towhere" text defining a list containing "DATA" in a form compatable with WinBUGS. @@ -224,3 +233,5 @@ } x } + +} Modified: trunk/R2WinBUGS/R/read.bugs.R =================================================================== --- trunk/R2WinBUGS/R/read.bugs.R 2007-05-20 15:42:40 UTC (rev 19) +++ trunk/R2WinBUGS/R/read.bugs.R 2007-05-20 15:45:39 UTC (rev 20) @@ -1,13 +1,7 @@ read.bugs <- function(codafiles, ...){ - if(!require(coda)) + if(!is.R() && !require("coda")) stop("package 'coda' is required to use this function") - if (is.R()){ - coda::mcmc.list(lapply(codafiles, coda::read.coda, - index.file = file.path(dirname(codafiles[1]), "codaIndex.txt"), - ...)) - }else{ - mcmc.list(lapply(codafiles, read.coda, - index.file = file.path(dirname(codafiles[1]), "codaIndex.txt"), - ...)) - } + mcmc.list(lapply(codafiles, read.coda, + index.file = file.path(dirname(codafiles[1]), "codaIndex.txt"), + ...)) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |