From: Ben B. <bo...@zo...> - 2007-08-08 13:58:50
|
I have taken a *fairly* recent svn copy of R2WinBUGS (missed the last couple of updates reported this morning, but I hope you can still use the patch) and made the changes required for me to run the example in ?bugs out of the box, without specifying a different command line than I would under Windows. Specifically, the changes are: bugs.R: change WINEPATH=NULL to WINEPATH=Sys.getenv("WINEPATH") bugs.run.R: take out a newWINE flag and pass WINEPATH through in call to win2native() wineutils.R: update win2native() These changes will require at least one tweak to the .Rd files, which I'm happy to make, but I'd like some other Linux users to check these mods out and make sure they don't break anything ... These changes have slipped through the cracks a couple of times, I'd love it they could get in this time so I can get up to date with R2WinBUGS -- for what it's worth, I can't run R CMD check on R2WinBUGS on my system because BRugs is now a required dependency, and it won't install under Linux ... cheers Ben Bolker diff -c -r R2WinBUGS.new/R/bugs.R bugs-r/trunk/R2WinBUGS/R/bugs.R *** R2WinBUGS.new/R/bugs.R 2007-08-07 16:53:47.000000000 -0400 --- bugs-r/trunk/R2WinBUGS/R/bugs.R 2007-06-14 09:37:13.000000000 -0400 *************** *** 8,14 **** program=c("WinBUGS", "OpenBUGS", "winbugs", "openbugs"), working.directory=NULL, clearWD=FALSE, useWINE=.Platform$OS.type != "windows", WINE=Sys.getenv("WINE"), ! newWINE=FALSE, WINEPATH=Sys.getenv("WINEPATH")) { program <- match.arg(program) if(program %in% c("openbugs", "OpenBUGS", "OpenBugs")) { --- 8,14 ---- program=c("WinBUGS", "OpenBUGS", "winbugs", "openbugs"), working.directory=NULL, clearWD=FALSE, useWINE=.Platform$OS.type != "windows", WINE=Sys.getenv("WINE"), ! newWINE=FALSE, WINEPATH=NULL) { program <- match.arg(program) if(program %in% c("openbugs", "OpenBUGS", "OpenBugs")) { diff -c -r R2WinBUGS.new/R/bugs.run.R bugs-r/trunk/R2WinBUGS/R/bugs.run.R *** R2WinBUGS.new/R/bugs.run.R 2007-08-07 17:17:41.000000000 -0400 --- bugs-r/trunk/R2WinBUGS/R/bugs.run.R 2007-06-14 09:37:13.000000000 -0400 *************** *** 4,13 **** newWINE = TRUE, WINEPATH = NULL){ if(useWINE && !is.R()) ! stop ("Non-Windows platforms not yet supported in R2WinBUGS for S-PLUS") ! ! ## BB: took out !newWINE (?), added WINEPATH ! if(useWINE) bugs.directory <- win2native(bugs.directory,WINEPATH=WINEPATH) ## Update the lengths of the adaptive phases in the Bugs updaters try(bugs.update.settings(n.burnin, bugs.directory)) --- 4,11 ---- newWINE = TRUE, WINEPATH = NULL){ if(useWINE && !is.R()) ! stop ("Non-Windows platforms not yet supported in R2WinBUGS for S-PLUS") ! if(useWINE && !newWINE) bugs.directory <- win2native(bugs.directory) ## Update the lengths of the adaptive phases in the Bugs updaters try(bugs.update.settings(n.burnin, bugs.directory)) diff -c -r R2WinBUGS.new/R/wineutils.R bugs-r/trunk/R2WinBUGS/R/wineutils.R *** R2WinBUGS.new/R/wineutils.R 2007-08-08 09:34:32.000000000 -0400 --- bugs-r/trunk/R2WinBUGS/R/wineutils.R 2007-06-14 09:37:13.000000000 -0400 *************** *** 45,61 **** } ! win2native <- function(x, useWINE=.Platform$OS.type != "windows", ! newWINE=TRUE, ! WINEPATH=Sys.getenv("WINEPATH")) { ! ## win -> native ! if (useWINE) { ! if (!newWINE) { ! winedriveTr(x) ! } else { ! system(paste(WINEPATH, " \"", x, "\"", sep = ""), intern = TRUE) ! } ! } else x } --- 45,52 ---- } ! win2native <- function(x, useWINE=.Platform$OS.type != "windows") { # win -> native ! if (useWINE) winedriveTr(x) else x } |