From: Gorjanc G. <Gre...@bf...> - 2008-10-07 09:00:17
|
Hi! > No, it doesn't. But, this does: > > schools.sim <- bugs(data, inits, parameters, model.file, > n.chains=3, n.iter=5000, > bugs.directory="/Applications/WinBUGS14", working.directory=".", > WINE="/Applications/Darwine/Wine.bundle/Contents/bin/wine", > WINEPATH="/Applications/Darwine/Wine.bundle/Contents/bin/winepath", > clearWD=TRUE) Then we are not successfull in finding wine binaries in Mac. This is done by R2WinBUGS:::findUnixBinary function. It goes like this (returning the result on the first success): * check if there is x (WINE or WINEPATH) environmental variable * check if there is /usr/bin/x * try with which x * try with locate x I thought that there is which command in Mac also. Afterall Mac uses unix internally. Can you please check in the terminal the result of the following commands: which wine which winepath locate wine locate winepath Btw. As stated last time, working.directory="." is not really needed unless you do want to keep the intermediate files in current working directory. -----Original Message----- From: Gorjanc Gregor [mailto:Gre...@bf...] Sent: Mon 10/6/2008 3:01 PM To: Sparapani, Rodney Cc: bug...@li... Subject: RE: [Bugs-r-devel] Mac bug regressions ... >> Unless you can provide a reasonable defaul for Mac, we can not help you! > > Umm. According to my notes I did. Or was that just a patch that I > applied to my local copy that was not incorporated into the mainline. > Can't find it right now. But, the default for all Mac applications is > /Applications. That was in the workaround I sent. The reason is that > that the Mac filesystem has permissions since it is just the Unix filesystem > with a few bells and whistles. The /Applications directory has the > permissions necessary to allow any user to install applications system-wide, > a nice compromise between security and practicality. Other directories are > secure so they are not an option (and for real Mac applications, they actually > need to be in /Applications: this is probably more than you need or want to know). Thank you for this details. /Applications/WinBUGS14 then seems to be a good default for Mac. Does anyone have any other opinion? Additionally, I wonder how can we set this default. There is already a bunch of arguments for the bugs() functions. Should we use bugs.directory=ifelse(???, "c:/Program Files/WinBUGS14/", "/Applications/WinBUGS14") or should we change the bugs.directory in the code conditionally on the OS? Uwe? >> Btw. Why do you use setwd(".")? It does not make sense, since this is changing the working directory to >> the current one. > I don't know. I got that from the Solaris example that you guys helped me with. > I figured you guys know what you are doing. My mistake :o) Actually, you came up with the example and I (we) did not bother ;) What you need is basically the same as example in ?bugs: model.file <- system.file(package="R2WinBUGS", "model", "schools.txt") # Some example data (see ?schools for details): data(schools) schools J <- nrow(schools) y <- schools$estimate sigma.y <- schools$sd data <- list ("J", "y", "sigma.y") inits <- function(){ list(theta=rnorm(J, 0, 100), mu.theta=rnorm(1, 0, 100), sigma.theta=runif(1, 0, 100)) } parameters <- c("theta", "mu.theta", "sigma.theta") schools.sim <- bugs(data, inits, parameters, model.file, n.chains=3, n.iter=5000, bugs.directory="/Applications/WinBUGS14", clearWD=TRUE) Can you please test if this works for you? I would like to know if wine variables are properly initialized. gg |