On 29/04/2010 12:45 PM, D Sonderegger wrote:
I'm using the dump command to pass data to WinBUGS/OpenBUGS/JAGS and have run
into a problem.
Here is some R-code:
foo <- array(1:6, dim=c(2,3))
dump('foo', file='dumpdata.R')
dump('foo', file='dumpdata.R', append=TRUE, evaluate=TRUE)
foo2 <- array(c(2,3,5,7,9,7,5,3), dim=c(2,4))
dump('foo2', file='dumpdata.R', append=TRUE)
And here is the file dumpdata.R:
foo <-
structure(1:6, .Dim = 2:3)
foo <-
structure(1:6, .Dim = 2:3)
foo2 <-
structure(c(2, 3, 5, 7, 9, 7, 5, 3), .Dim = c(2L, 4L))
Looking at the help page, the second dump of foo should look like the dump
of foo2 because the evaluate=TRUE flag tells it to evaluate the promises.
Unfortunately dump's control parameter didn't offer any solution, either.
Am I missing anything?
I don't get it. Why would the second dump not show the values 1:6? How
would it know about the vector or the new dimension that you put into foo2?
I think you need to be more explicit about what output you were
expecting, and why.
Duncan Murdoch
P.S. I've tried this on versions 2.11 and 2.9 and the results are the same.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.