I will do that Brian. Thanks for your replies.I agree on the NAs but
na.omit() is not a problem as the process runs often and only cribs
sometimes. Thats the puzzle. I will do dput() and send it across.

Thx
Raghu

On Thu, Jul 15, 2010 at 4:22 PM, Brian G. Peterson <brian@braverock.com>wrote:

> Perhaps you should communicate directly with the author of the tradesys
> package, since your error resides there.
>
> It looks as though you are running into an na.omit problem.  Note that
> your differing lengths would be explained by the leading NA's in your
> series given your SMA parameters of 50 and 200.
>
> Also, while you did provide code, you did not reference a time series
> that could actually be used to replicate your error, making your code
> non-reproducible, and any replies you get are at best speculative.  Next
> time, you (or any other poster) should use one of the many example time
> series data sets included in R, or use some other method like dput() to
> create a reproducible example. str() does not create a reproducible
> example.
>
>
>
>
> On Thu, 2010-07-15 at 08:59 +0100, Raghu wrote:
> > Hello
> >
> > I tried running the following code and it works fine most of the times
> but
> > there are instances (no change in parameters or files or anything) when
> it
> > cribs. I tried analysing but could not find the fault and finally the
> only
> > solution that works is closing the instance of R and restarting! Any
> ideas
> > pls?
> >
> > d <- expr.frame(x, list(MAf=quote(SMA(Last, 50)), MAs=quote(SMA(Last,
> > 200))))
> > Error in data.frame(c(1000, 1001.53, 987.17, 976.28, 960.32, 951.93,
> > 949.29,  :
> >   arguments imply differing number of rows: 3637, 3588, 3438
> >
> > And the above is the error message that I get. This is really strange
> > because the same piece of code works brilliantly fine 99% of the time but
> > that is worrisome. Is it because I have a 64-bit computer and the R
> version
> > is a 32-bit system? I am not sure this is a finance related query but
> > because it comes under the purview of 'tradesys' I thought I would post
> it
> > here. Advance apologies if anyone is offended for my posting on this
> forum
> > instead of a general R-forum. I am also posting the str(d) below when it
> > runs successfully.
> >
> >  str(d)
> > List of 5
> >  $ Open : num [1:3637] 1000 1002 987 976 960 ...
> >  $ Last : num [1:3637] 1000 989 978 964 953 ...
> >  $ MAf  : num [1:3637] NA NA NA NA NA NA NA NA NA NA ...
> >  $ MAs  : num [1:3637] NA NA NA NA NA NA NA NA NA NA ...
> >  $ Cross: num [1:3637] 0 NA NA NA NA NA NA NA NA NA ...
> >  - attr(*, "class")= chr "expr.frame"
> >  - attr(*, "row.names")= chr [1:3637] "1" "2" "3" "4" ...
> >  - attr(*, "exprlist")=List of 3
> >   ..$ MAf  : language SMA(Last, 50)
> >   ..$ MAs  : language SMA(Last, 200)
> >
> >
> > Thanks in advance.
> >
>
>
> --
> Brian G. Peterson
> http://www.braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
>
>


-- 
'Raghu'

	[[alternative HTML version deleted]]

