[R] [R-SIG-Finance] FinCenter in timeSeries with "merge", "cbind" and "rbind"

David Winsemius dwinsemius at comcast.net
Tue Jul 5 04:41:35 CEST 2011


On Jul 4, 2011, at 6:47 PM, Kenneth Roy Cabrera Torres wrote:

> Hi R users:
>
> When I try to merge or bind (cbind or rbind) two series,
> both with a "FinCenter" different that GMT, the
> result is "GMT" not the original financial center?

It's not in the help(cbind.timeSeries) page but looking at the  
function  (and at the documentation for the timeSeries class) you see  
that there is a "zone" argument and that it is "GMT" by default. So  
why don't you add something meaningful to your code (... that is not  
presented in a reproducible manner for testing.)

It is listed in the documentation as zone="", but in the cbind  
function call, the code is zone="GMT". It appears that the "zone"  
argument might be for input and the FinCenter might be for output in  
the help page for timeDate, but I think that aspect of the various  
parts of the documentation is rather vague and might do with a bit of  
clarification.

-- 

David.
>
> What am I doing wrong?
>
> ######################################################
> require(timeSeries)
>
> getRmetricsOptions("myFinCenter")
> setRmetricsOptions(myFinCenter = "America/Bogota")
> getRmetricsOptions("myFinCenter")
>
> fechas <- format(timeCalendar(2010, sample(12, 6)))
> datos <- matrix(round(rnorm(6), 3))
> t1 <- sort(timeSeries(datos, fechas, units = "A"))
> t1
>
> fechas <- format(timeCalendar(2010, sample(12, 6)))
> datos <- matrix(round(rnorm(6), 3))
> t2 <- sort(timeSeries(datos, fechas, units = "B"))
> t2
>
> merge(t1,t2)
> cbind(t1,t2)
> rbind(t1,t2)
> ######################################################
>
> Thank you for your help.
>
> Kenneth
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R  
> questions should go.
>
> _______________________________________________
>
>
> e at 1 Churchill Place, London, E14 5HP.  This email may relate to  
> or be sent from other members of the Barclays Group.
> _______________________________________________
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
>
> ______________________________________________
> 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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list