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

Diethelm Wuertz wuertz at itp.phys.ethz.ch
Sun Sep 27 15:24:04 CEST 2009


Jeff Ryan wrote:
> Nicolas,
>
> 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...
>   

Dear Jeff,

I don't like to comment this sentence (and also not the previous ones 
before).

Documentation is written to be read!  The users can
have a look into the free FAQ eBook:

"A Discussion of Time Series Objects for R in Finance"

Download it for free from

--- http://www.rmetrics.org/ebook.htm ---

There you will find also information on the usage of c,
cbind, rbind, and merge, and how these functions work
and how they should be used.

In this eBook many frequently asked questions are answered
on an objective level. Everybody is invited to contribute to
this eBook and to improve its content. Suggestions are
welcome.


Diethelm


**********************
> Jeff
>
> 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"))
>>>       
>> GMT
>>           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.
>>
>>     
>
>
>
>



More information about the R-SIG-Finance mailing list