Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`Error in file(con, "r") : cannot open the connection` from running BRugsFit()

Tags:

r

I have a error about Error in file(con, "r") : cannot open the connection from running BRugsFit(). I assume all the input arguments are fine, and the calling code is

> output = BRugsFit("model.txt", data, inits, numChains = 2, seed=6, parametersToSave,nBurnin = 100,nIter = 1000, nThin = 5, coda = T,digits = 5)

****
* BlackBox
* string too long
- HostFiles.Init  (pc=00003FB1, fp=BFFDE550)
- HostFiles.$$  (pc=0000000A, fp=BFFDE560)
****
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file '/tmp/RtmpU7v9PZ/buffer.txt': No such file or directory

So I wonder what might be the reason of the error, and how to solve it? Thank you so much!


1 Answers

It tells you that the file model.txt doesn't exist. Try to indicate the full path to the file:

output <- BRugsFit("/path/to/file/model.txt", data, inits, numChains = 2, seed=6, parametersToSave,nBurnin = 100,nIter = 1000, nThin = 5, coda = T,digits = 5)

or first set the working directory with setwd:

setwd("/path/to/file/")
like image 64
Julián Urbano Avatar answered Dec 20 '25 17:12

Julián Urbano