From: Rodney S. <rsp...@mc...> - 2008-09-12 14:03:50
|
Uwe Ligges wrote: > I cannot reproduce on Windows even when using 3 different directories: > > - one for data > - one as working directory > - one for the model file > > > > schools <- read.table ("d:/schools.dat", header=T) > 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") > setwd("d:/temp") > schools.sim <- bugs (data, inits, parameters, "d:/uwe/schools.bug", > n.chains=3, n.iter=1000, working.directory="d:/temp") > > > Simply works for me .... > > Uwe Hi Uwe: But, you have the command setwd("d:/temp") and I don't. However, this does not work around the problem either: library(R2WinBUGS) schools <- read.table ("/usr/local/doc/r2winbugs/schools.dat", header=T) 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") setwd(".") schools.sim <- bugs (data, inits, parameters, "/usr/local/doc/r2winbugs/schools.bug", n.chains=3, n.iter=1000, working.directory=".") Warning message: In file.create(to[okay]) : cannot create file '/usr/local/doc/r2winbugs/schools.txt', reason 'Permission denied' -- Rodney Sparapani Center for Patient Care & Outcomes Research (PCOR) Sr. Biostatistician Department of Medicine Was 'Name That Tune' rigged? Medical College of Wisconsin (MCW) WWLD: What Would Lombardi Do Milwaukee, WI, USA |