Re: [Rd] I want to get a reference to this time series object

2009-09-16 Thread Abhijit Bera
Thanks guys. I see the mistake I was doing. I was forgetting an argument; that's why I wasn't getting the output. "[" is a function. On 9/16/09, mtmor...@fhcrc.org wrote: > > Quoting Abhijit Bera : > > I'm trying to get a reference to this object in C >> >> SWX.RET[1:6,c("SBI,"SPI","SII")] >> >>

Re: [Rd] I want to get a reference to this time series object

2009-09-16 Thread mtmorgan
Quoting Abhijit Bera : I'm trying to get a reference to this object in C SWX.RET[1:6,c("SBI,"SPI","SII")] While i am able to access and use a plain SWX.RET object, I'm getting confused on how to create an object with the array subscripts like above. Here is what I tried to do. It doesn't work

Re: [Rd] I want to get a reference to this time series object

2009-09-16 Thread Romain Francois
On 09/16/2009 09:40 AM, Abhijit Bera wrote: So I should use the R parser? If you want to parse R code, yes Actually I'm trying to develop a JS interface for R. So I'm terribly confused with the design aspects. Won't parsing be slower? sure. but I suspect SWX.RET[1:6,c("SBI,"SPI","SII")] is

Re: [Rd] I want to get a reference to this time series object

2009-09-16 Thread Abhijit Bera
So I should use the R parser? Actually I'm trying to develop a JS interface for R. So I'm terribly confused with the design aspects. Won't parsing be slower? Is there a better way to do what I'm doing other than parsing? Regards Abhijit On Wed, SSep 16, 2009 at 12:48 PM, Romain Francois < rom

Re: [Rd] I want to get a reference to this time series object

2009-09-16 Thread Romain Francois
Hi, Luckily, R has its own parser, so you don't have to reimplement it. Just parse your string 'SWX.RET[1:6,c("SBI,"SPI","SII")]' and eval the parsed expression(s). The R_ParseVector function will help you. Romain On 09/16/2009 09:02 AM, Abhijit Bera wrote: I'm trying to get a reference to

[Rd] I want to get a reference to this time series object

2009-09-16 Thread Abhijit Bera
I'm trying to get a reference to this object in C SWX.RET[1:6,c("SBI,"SPI","SII")] While i am able to access and use a plain SWX.RET object, I'm getting confused on how to create an object with the array subscripts like above. Here is what I tried to do. It doesn't work because "[" is obviously