[R] Error: expected the collection operator c error pos 98 (error on line 1)

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Apr 10 12:13:04 CEST 2008



Blanchard, Suzette wrote:
> Greetings,
> 
>  
> 
>       I implemented BRugs to run the EWOC model with a cohort size N=1.  I output the simulation data using bugsdata(data),  where data is the following list.
> 
>   
> 
>> data
> 
> $Dose
> 
> [1] 140
> 
>  
> 
> $Y
> 
> [1] 0
> 
>  
> 
> bugsdata(data)  puts out the file data.txt as follows.
> 
>  
> 
> list(Dose=1.40000E+02, Y=0.00000E+00)
> 
>  
> 
> after I type the following line
> 
> modelData("data.txt")              # read data file
> 
>  
> 
> I get the ERROR: 
> 
> expected the collection operator c error pos 98 (error on line 1)
> 
>  
> 
> If I rewrite the file
> 
> 
> 
> list(Dose=c(1.40000E+02), c(Y=0.00000E+00))
> 
>  
> 
> it runs fine.  Can you suggest a way to get the output dataset to automatically put the
> 
> c( ) on the data when the sample size is 1?

Hmmm, I will take a look how to implement it.

I guess you have modeled Y to be a vector by indexing with brackets in 
your BUGS model? It works for me if I use Y without index brackets in a 
BUGS model file.

Best wishes,
Uwe



>  
> 
> Thank you,
> 
> Suzette
> 
>  
> 
> Suzette Blanchard, Ph.D.
> Assistant Professor, Dept. of Biostatistics
> City of Hope
> 1500 East Duarte Rd
> Duarte, CA 91010-3000
> ph: (626) 256-4673 ext:64446
> sblanchard at coh.org
>  
> 
> 
> ---------------------------------------------------------------------
> 
> SECURITY/CONFIDENTIALITY WARNING:  \ This message an...{{dropped:24}}
> 
> ______________________________________________
> 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.



More information about the R-help mailing list