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

From: Uwe Ligges <ligges_at_statistik.tu-dortmund.de>
Date: Thu, 10 Apr 2008 12:27:12 +0200

Quick inspection shows that we cannot do anything.

In BUGS, Y indicates a scalar and Y[] indicates a vector. For scalar Y, you need Y=0.00000E+00 in your data file, but for vector Y[], you need Y=c(0.00000E+00) in your data file.

This means you need to know what Y is in the model and I do not see any API I can use to ask the BRugs.dll what Y actually is.

So question redirected to Andrew Thomas (in CC).

Best wishes,
Uwe

Uwe Ligges wrote:

> 
> 
> 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.
>

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 10 Apr 2008 - 10:54:37 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 Thu 10 Apr 2008 - 11:30:27 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