[R] R2WinBUGS is broken

From: John Smith <zmring_at_gmail.com>
Date: Thu, 31 Jan 2008 13:18:28 -0500


Dear R-users,

I am trying to use the following code to reproduce results from Prof. Gelman's book, but have the listed error for R2WinBUGS version (the openbugs version is good). I am using R-2.6.1 on windows XP, and all the R packages are most current ones. schools.bug can be found at http://www.stat.columbia.edu/~gelman/bugsR/runningbugs.html . Can anyone help me to figure out what's going wrong?

rm(list=ls())
library(R2WinBUGS)
library ('BRugs')
setwd('C:/bayesian/bda/codes/example_5_5') data(schools)
J <- nrow(schools)
y <- schools$estimate
sigma.y <- schools$sd
data <- list(J=J, y=y, sigma.y=sigma.y)

inits <- function()
  list(theta=rnorm(J,0,100), mu.theta=rnorm(1,0,100),

       sigma.theta=runif(1,0,100))
parameters <- c('theta', 'mu.theta', 'sigma.theta') schools.sim <- bugs(data, inits, parameters, model.file='schools.bug',

                    n.chains=3, n.iter=1000, clearWD=TRUE)
## schools.sim <- bugs(data, inits, parameters, model.file='schools.bug',

## n.chains=3, n.iter=1000, clearWD=TRUE,
## program = 'openbugs')
print(schools.sim)
plot(schools.sim)

Error in matrix(unlist(mx), ncol = n.cols, byrow = TRUE) :   invalid 'nrow' value (too large or NA)

Thanks

        [[alternative HTML version deleted]]



R-help_at_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. Received on Thu 31 Jan 2008 - 18:23:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 01 Feb 2008 - 10:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive