[R] importing data from BUGS format to R?

Pseudomonas sdgs at gmx.net
Tue Jan 5 11:35:24 CET 2010



Martyn Plummer-2 wrote:
> 
> I wrote a function called "bugs2jags", which you will find in the coda
> package, for converting WinBUGS data files into the data format used by
> JAGS which is, by no coincidence, the format used by the R function
> dump().
> 

First of all excuse me for reviving this very old thread - if it is the
preferred way in this forum/ mailinglist, I will start a new one instead.
I'm a computational biologist programming in C++ and I'm actually not
familiar with R. But I wrote a small program to analyse Win-/OpenBugs output
(CODA) according to this paper:
http://dx.doi.org/10.1016/j.anbehav.2004.08.011 . As I'm working with Mac
and Linux (Kubuntu 9.10 „Karmic Koala“ at the moment) and WINbugs only runs
on Windows natively (as it's name says), I want to switch to JAGS instead.
Now I have the problem to change the WinBugs formatted model and data into
JAGS/R formatted ones, which is quite difficult without knowing the actual
differences between R and S(-PLUS) programming languages. (The latter one
seems to be the basis of WinBugs' format.) I'm not completely sure whether
"bugs2jags" can be applied to this case, but when I tried to execute it with
the main example from the above mentioned paper (see attachment), it showed
this error message:

> library(coda)
Lade nötiges Paket: lattice
> bugs2jags("WinBugs.txt","Jags.txt")
Fehler in parse(file = file) :
  WinBugs.txt:19:9: Unerwartetes Symbol
18: list(individuals = 5, dyads = 9)
19: ind1[ ] ind2
            ^
>

Thank you in anticipation
Sascha Siemann

http://n4.nabble.com/file/n998943/WinBugs.txt WinBugs.txt 
-- 
View this message in context: http://n4.nabble.com/importing-data-from-BUGS-format-to-R-tp794525p998943.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list