An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080917/b5e8f04e/attachment.pl>
A Simple Question
2 messages · Gao, Aijun, Ben Bolker
Gao, Aijun <Aijun.Gao <at> i3statprobe.com> writes:
Hi: I am trying to run your SCHOOLS example as following and I get an error
message stated that : Error: could not
find function "bugs" Would you please help me since I would like to run some WINBUG programs from
your R by reading external data
and I am new to R? Do I missing some function? Should I install some extra files? Thanks a lot in advance for your help!!
schools <- read.table ("schools.dat", header=TRUE)
J <- nrow(schools)
y <- schools$estimate
sigma.y <- schools$sd
data <- list ("J", "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, "schools.bug", n.chains=3, n.iter=1000)
Error: could not find function "bugs"
I think you need library(R2WinBUGS) before you try to run the bugs command this is all assuming that you have WinBUGS installed ... Ben Bolker