Skip to content
Prev 348528 / 398500 Next

problem in R2JAGS

Hi everyone,

I need your help to correct R code using R2JAGS. The problem is when i
defined testJAGSdata which contains on all the data as following


testJAGSdata <- read.bugsdata("bugsdata.R")
bugsdata.R<-read.table("F:/JAGS/bugsdata.R")

i found this error
Error in file(filename, "r") : cannot open the connection
In addition: Warning message:
In file(filename, "r") :
  cannot open file 'bugsdata.R': No such file or directory
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
 :
  line 2 did not have 3 elements

and

Error in jags(data = testJAGSdata, inits = testJAGSinits, model.file =
"testJAGS.txt",  :
  object 'testJAGSdata' not found

How can i solve this problem? because i think the problem in bugsdata.R but
this file works correctly.

Any help would be highly appreciated

Many thanks in advance