[R] Could dynlm function work for xts objects?
Achim Zeileis
Achim.Zeileis at uibk.ac.at
Thu Apr 12 08:23:07 CEST 2012
On Thu, 12 Apr 2012, jpm miao wrote:
> It seems to only works for zoo or ts objects?
It was tested for zoo, ts, and plain numeric vectors.
> I tried to run it for xts objects, and error message occurs.
I had a quick look if this can be avoided. But xts' merge() method is not
fully compatible with zoo's, so it currently does not work. I'll
investigate whether this can be improved.
> Once I coerce it to be an zoo object (by as.zoo), it works.
Yes, that is recommended at the moment.
Z
> Error message:
>
>
> Error in model.frame.default(formula = dynformula(PIh - PI ~ L(X, 0:i) + :
> variable lengths differ (found for 'L(X, 0:i)')
> In addition: Warning messages:
> 1: In zoo(coredata(x), order.by = index(x), ...) :
> some methods for ?zoo? objects do not work if the index entries in
> ?order.by? are not unique
> 2: In zoo(coredata(x), order.by = index(x), ...) :
> some methods for ?zoo? objects do not work if the index entries in
> ?order.by? are not unique
>
> ______________________________________________
> 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