[R-SIG-Finance] timeSeries:: bizarre rbind behavior with colnames

Jeff Ryan jeff.a.ryan at gmail.com
Wed Sep 23 17:59:07 CEST 2009


I don't think this is a list question per se, as you should really
contact the maintainer.

While I'll agree the design is odd, if you're insisting on using
timeSeries, and you find a problem, it would be more useful to all if
you proposed a patch.

Complaints/demands for explanations/etc aren't productive, and
effectively show no consideration for the time and effort that
_contributors_ make to R.

If you're looking for a better time-series solution than a matrix as
an interim representation, I would suggest xts.  Or zoo...


On Wed, Sep 23, 2009 at 10:43 AM, Nicolas Chapados
<nicolas.chapados at gmail.com> wrote:
> Dear list,
> Looking at the code for timeSeries::rbind, it appears that it insists
> on concatenating the names of the two series it's trying to bind, even
> if they match exactly, thereby creating a longer series name.  This is
> in sharp contrast to, e.g. rbind.data.frame.  This creates very
> badly-behaved column names (i.e. horrendously-long) in the case where
> one attempts to construct a timeSeries incrementally.
> For example:
>> rbind(timeSeries(1.0, timeDate("1996-01-01"), units="Level"), timeSeries(2.0, timeDate("2009-01-01"), units="Level"))
>           Level_Level
> 1996-01-01           1
> 2009-01-01           2
> Can someone explain the design rationale for choosing to concatenate
> the column names in such a manner?  In the short term, I resolved to
> incrementally constructing a matrix, and at the very end building a
> timeSeries, but I would really prefer to keep timeSeries all along...
> Many thanks for any help!
> + Nicolas Chapados
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.

Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics

More information about the R-SIG-Finance mailing list