[R-SIG-Finance] ts object

Michael Weylandt michael.weylandt at gmail.com
Thu May 30 23:05:04 CEST 2013


To echo what Deo is saying, if the question is 'how to do X with ts objects' the answer is almost always going to be 'Use xts instead'. It's not quite a drop in for one or two things, but its basically always going to be better for whatever you may wish. 

M

On May 30, 2013, at 15:34, Deo Jaiswal <deo.jaiswal at gmail.com> wrote:

> require(xts)
> data <- c(100,101,99)
> dates <-
> c(as.POSIXlt('2013-05-20'),as.POSIXlt('2013-05-21'),as.POSIXlt('2013-05-30'))
> xts(c,order.by=dates)
> 
> Deo Jaiswal
> Student of R
> 
> On Thu, May 30, 2013 at 9:17 AM, Oleg Mubarakshin <
> oleg.mubarakshin at gmail.com> wrote:
> 
>>  Dear colleagues,
>> 
>> How can I create time series (ts) object with specified dates?
>> E.g.
>> data = c(100,101,99)
>> dates = c(“2013-05-20”,“2013-05-21”,“2013-05-30”)
>> 
>> and plot it with specified time range? In case I have several ts and want
>> to plot them on one chart
>> E.g.
>> ts1, ts2, ts3
>> date >= “2013-05-20” & date <= “2013-05-25”
>> 
>> Thank you!
>> 
>>  Sincerely,
>> Oleg Mubarakshin
>> 
>> om at quant-lab.com
>> [image: logo_ql_email] <http://quant-lab.com/>
>> 
>> _______________________________________________
>> 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.
> 
>    [[alternative HTML version deleted]]
> 
> _______________________________________________
> 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.



More information about the R-SIG-Finance mailing list