[R] R2WinBUGS: Data loading error

Hadassa Brunschwig h.brunschwig at utoronto.ca
Thu Sep 22 14:52:05 CEST 2005


Hi R-Help!

I am trying to use R2WinBUGS but I get the following error message in WinBUGS
(and there must be something wrong with my R statement as I tried it directly in
WinBUGS and it worked):

display(log)
check(C:/Documents and Settings/Daikon/Roche/pop_model.txt)
model is syntactically correct
data(C:/Documents and Settings/Daikon/Roche/data.txt)
expected key word structure
compile(7)
...(and of course nothing works after that)

and when I close WinBUGS i get:
Error in file(file, "r") : unable to open connection
In addition: Warning message:
cannot open file 'codaIndex.txt' 

Does anyone know what this 'expected key word structure' means?
This is my R code (and I guess my model file is ok):

modelA     <- c("C:/Documents and Settings/Daikon/Roche/pop_model.txt")
n          <- length(unique(subsetA$subject))    #number of subjects
nt         <- 13                                 #number of days
Y          <- subsetA$concentr                   #concentration per day/subject
t          <- 1:13                               #days
dataA      <- list("n","nt","Y","t")
parameters <- c("tau","C0","st90","C0.pop","st90.pop","tau.cpop","tau.stpop")
inits      <-
list(tau=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),C0=5,st90=4,C0.pop=5,st90.pop=4,tau.cpop=0.2,tau.stpop=1)
mcmcA      <-
bugs(dataA,inits,parameters,modelA,debug=T,n.chains=7,bugs.directory="c:/Program
Files/WinBUGS14",working.directory="C:/Documents and Settings/Daikon/Roche")


Thanks so much...

Hadassa


-- 

Hadassa Brunschwig
Birmannsgasse 10A
CH-4055 Basel
Switzerland
Phone: +41 78 797 6065
Email: h.brunschwig at utoronto.ca




More information about the R-help mailing list