Paul Heinrich Dietrich
2009-Feb-17 14:45 UTC
[R] How to connect R and WinBUGS/OpenBUGS/LinBUGS in Linux in Feb. 2009
Hi all, I've managed to get JAGS working on my Ubuntu Hardy Linux with a 32-bit computer and AMD processors using R 2.8.1. JAGS is great. I've read that JAGS is the fastest, but that hasn't been my experience. At any rate, I have more experience with WinBUGS under Windows and would like a version of that working as well. It seems like I've read a lot on the subject and tried a lot, but haven't managed to get BUGS to work yet. The most success I've had is to install WinBUGS or OpenBUGS using this method: http://www.math.aau.dk/~slb/kurser/bayes-08/install.html What you also need to know is that you need to open Wine and add a drive. Although Z is recommended, I haven't been able to specify it, but have gotten a D drive to work, using: wine D:/opt/OpenBUGS/winbugs.exe Using this method, OpenBUGS opens. Now, to be able to open it with R. I've read all sorts of discussions about BRugs (which is no longer on CRAN, but old versions can still be found), rbugs, and R2WinBUGS (which I'm used to using on Windows with WinBUGS). Some people say R2WinBUGS cannot run OpenBUGS on Linux, some claim they've done it (I think). It seems the same thing with everything else. I've tried making the linbugs and cbugs file recommended elsewhere online. It's all very confusing. Can someone show a method that works currently, along with some sample code? I'm also new to Linux, and confused by path conventions. For example, in rbugs, it shows an example of a path such as "/var/scratch/jyan/wine-20040408/wine", and I don't see how to modify this. I have no /var/scratch to begin with, and think Wine is installed in /home/me/.wine...(I don't have Linux in front of me right now). Please help. Thanks. -- View this message in context: http://www.nabble.com/How-to-connect-R-and-WinBUGS-OpenBUGS-LinBUGS-in-Linux-in-Feb.-2009-tp22058716p22058716.html Sent from the R help mailing list archive at Nabble.com.
Uwe Ligges
2009-Feb-17 16:56 UTC
[R] How to connect R and WinBUGS/OpenBUGS/LinBUGS in Linux in Feb. 2009
Paul Heinrich Dietrich wrote:> Hi all, > I've managed to get JAGS working on my Ubuntu Hardy Linux with a 32-bit > computer and AMD processors using R 2.8.1. JAGS is great. I've read that > JAGS is the fastest, but that hasn't been my experience. At any rate, I > have more experience with WinBUGS under Windows and would like a version of > that working as well. > > It seems like I've read a lot on the subject and tried a lot, but haven't > managed to get BUGS to work yet. The most success I've had is to install > WinBUGS or OpenBUGS using this method: > http://www.math.aau.dk/~slb/kurser/bayes-08/install.html > > What you also need to know is that you need to open Wine and add a drive. > Although Z is recommended, I haven't been able to specify it, but have > gotten a D drive to work, using: > > wine D:/opt/OpenBUGS/winbugs.exe > > Using this method, OpenBUGS opens. Now, to be able to open it with R. I've > read all sorts of discussions about BRugs (which is no longer on CRAN, but > old versions can still be found), rbugs, and R2WinBUGS (which I'm used to > using on Windows with WinBUGS). Some people say R2WinBUGS cannot run > OpenBUGS on Linux, some claim they've done it (I think). It seems the same > thing with everything else. I've tried making the linbugs and cbugs file > recommended elsewhere online. It's all very confusing.For short: It is quite unlikely that BRugs / OpenBUGS (which is called LinBUGS under Linux) works natively under your Linux (although it might work under very specific settings). BRugs is available for Windows users from the "CRAN extras" repsository maintained by Brian Ripley. We moved it in order to meet GPL compliance issues. Hence a standard recommendation is to use R2WinBUGS under native R under Linux with WinBUGS running under wine. R2WinBUGS can use wine to do so. See the help page ?bugs once you have loaded R2WinBUGS. Best wishes, Uwe Ligges> Can someone show a method that works currently, along with some sample code? > I'm also new to Linux, and confused by path conventions. For example, in > rbugs, it shows an example of a path such as > "/var/scratch/jyan/wine-20040408/wine", and I don't see how to modify this. > I have no /var/scratch to begin with, and think Wine is installed in > /home/me/.wine...(I don't have Linux in front of me right now). > > Please help. Thanks.
Paul Heinrich Dietrich
2009-Feb-21 14:25 UTC
[R] How to connect R and WinBUGS/OpenBUGS/LinBUGS in Linux in Feb. 2009
I just wanted to post in conclusion to this thread that I have had success running WinBUGS from R via R2WinBUGS, with the help of Gorjanc, Uwe, and Ben by email outside of this thread. I may have had a permissions problem, that was probably corrected by entering this in the terminal: me at computer:~$ chmod -R u+w /home/me/.wine/drive_c/"Program Files"/WinBUGS14/>From here, I opened R, entered library(R2WinBUGS), then ?bugs, thencopy/pasted the example, and ran it exactly. My mistake that prevented it all from running was that I started R as sudo R, thinking that would give me more permissions, because I thought I was having permissions-oriented problems. But this is wrong. When I started R by merely entering R in the terminal, the example code ran perfectly. Success! Winepaths did not have to be specified because WinBUGS was installed in the usual place (c:/Program Files/WinBUGS14/"). Other people have emailed me, indicating that newer versions of WINE have not worked for them, so I am back with WINE 1.0. I hope this helps others trying to run WinBUGS on Linux. -- View this message in context: http://www.nabble.com/How-to-connect-R-and-WinBUGS-OpenBUGS-LinBUGS-in-Linux-in-Feb.-2009-tp22058716p22136577.html Sent from the R help mailing list archive at Nabble.com.