[WinBUGS] - model is right, code won't run (gen.inits() cannot be executed)

#1
Hi everyone,

I'm new to bugs, calling it from R, and my model won't run. Here are the logs:

display(log)
check(C:/Users/Chris/AppData/Local/Temp/RtmpoZoYto/model678418be.txt)
model is syntactically correct
data(C:/Users/Chris/AppData/Local/Temp/RtmpoZoYto/data.txt)
data loaded
compile(1)
model compiled
inits(1,C:/Users/Chris/AppData/Local/Temp/RtmpoZoYto/inits1.txt)
model is initialized
gen.inits()
command #Bugs:gen.inits cannot be executed (is greyed out)
thin.updater(1)
update(50)
set(int)
set(alpha)
set(bpop)
set(bintwar)
set(bcivwar)
set(bethwar)
set(bneighborwar)
set(bgroups)
set(bexclpop)
set(bexclpopsq)
set(bdiscpop)
set(bpoltrqnew)
set(bpolity)
set(bpolitysq)
set(bgdp)
set(bpcgdp)
set(sigma.y.sq)
set(sigma.a.sq)
set(deviance)
dic.set()
command #Bugs:dic.set cannot be executed (is greyed out)
update(50)
coda(*,C:/Users/Chris/AppData/Local/Temp/RtmpoZoYto/coda)
command #Bugs:coda cannot be executed (is greyed out)
stats(*)
command #Bugs:stats cannot be executed (is greyed out)
dic.stats()

DIC
history(*,C:/Users/Chris/AppData/Local/Temp/RtmpoZoYto/history.odc)
command #Bugs:history cannot be executed (is greyed out)
save(C:/Users/Chris/AppData/Local/Temp/RtmpoZoYto/log.odc)
save(C:/Users/Chris/AppData/Local/Temp/RtmpoZoYto/log.txt)

-----------------------------------------

Here is the R code if it helps:
Code:
 bugsdata2=list(J=141,N=1963,Y=as.numeric(trainingb$nsoldiers),groupnum=cnum2,pop=as.numeric(X2$population),intwar=as.numeric(X2$intwar),civwar=as.numeric(X2$civwar),ethwar=as.numeric(X2$ethwar),
            neighborwar=as.numeric(X2$neighborsatwar),groups=as.numeric(X2$groups),exclpop=as.numeric(X2$exclpop),exclpopsq=as.numeric(X2$exclpop^2),discpop=as.numeric(X2$discpop),
            poltrqnew=as.numeric(X2$poltrqnew),polity=as.numeric(X2$polity2),politysq=as.numeric(X2$polity2sq),gdp=as.numeric(X2$gdp),pcgdp=as.numeric(X2$pcgdp))
               
  
    
    bugsmodel2<-function(){
    for(i in 1:N){      
    Y[i]~dnorm(mu[i],tau.y)
    mu[i]<-int+alpha[groupnum[i]]+bpop*pop[i]+bintwar*intwar[i]+bcivwar*civwar[i]+bethwar*ethwar[i]+bneighborwar*neighborwar[i]+bgroups*groups[i]+bexclpop*exclpop[i]+bexclpopsq*exclpopsq[i]+bdiscpop*discpop[i]+bpoltrqnew*poltrqnew[i]+bpolity*polity[i]+bpolitysq*politysq[i]+bgdp*gdp[i]+bpcgdp*pcgdp[i]
    }
                      
    for(j in 1:J){
    alpha[j]~dnorm(0,tau.a)
    }
    
    tau.a<-pow(sigma.a.sq,-2)
    tau.y<-pow(sigma.y.sq,-2)
    sigma.y.sq~dunif(0,100)
    sigma.a.sq~dunif(0,100)
    
    int~dnorm(0,.01)
    bpop~dnorm(0,.01)
    bintwar~dnorm(0,.01)
    bcivwar~dnorm(0,.01)
    bethwar~dnorm(0,.01)
    bneighborwar~dnorm(0,.01)
    bgroups~dnorm(0,.01)
    bexclpop~dnorm(0,.01)
    bdiscpop~dnorm(0,.01)
    bpoltrqnew~dnorm(0,.01)
    bpolity~dnorm(0,.01)
    bpolitysq~dnorm(0,.01)
    bgdp~dnorm(0,.01)
    bpcgdp~dnorm(0,.01)      
    bexclpopsq~dnorm(0,.01)    
    }
        m2.parameters<-c("int","alpha","bpop","bintwar","bcivwar","bethwar","bneighborwar","bgroups","bexclpop","bexclpopsq","bdiscpop","bpoltrqnew","bpolity","bpolitysq","bgdp","bpcgdp","sigma.y.sq","sigma.a.sq")
    
    m2.inits<- function(){
       list(
      int=rnorm(1,0,3),
    bpop=rnorm(1,0,1),
    bintwar=rnorm(1,0,1),
    bcivwar=rnorm(1,0,1),
    bethwar=rnorm(1,0,1),
    bneighborwar=rnorm(1,0,1),
    bgroups=rnorm(1,0,1),
    bexclpop=rnorm(1,0,1),
    bdiscpop=rnorm(1,0,1),
    bpoltrqnew=rnorm(1,0,1),
    bpolity=rnorm(1,0,1),
    bpolitysq=rnorm(1,0,1),
    bgdp=rnorm(1,0,1),
    bpcgdp=rnorm(1,0,1),
    bexclpopsq=rnorm(1,0,1),
    sigma.y.sq  =runif(1,0,10),
      sigma.a.sq =runif(1,0,10),
      alpha=rnorm(141,0,1)
      )
      }
        soldiersmodel<-bugs(bugsdata2,m2.inits,m2.parameters,bugsmodel2,n.chains=1,n.iter=100,debug=TRUE)
-------------------------

Thanks so much for any help!