[R] handling dates in R

Don MacQueen macq at llnl.gov
Wed Aug 28 20:31:48 CEST 2002


At 10:47 AM -0500 8/28/02, Pijus Virketis wrote:
>Dear all,
>
>I am just getting into R, and I arrive with a task in hand. I need 
>to handle time series of price data, and use them in regressions and 
>cluster models of various kinds. At this time, I am just trying to 
>learn the most graceful ways of working with date-indexed data in R 
>in general.
>
>I know of the ts object; however, it seems to assume a very regular 
>periodicity of the data. Unfortunately, price data is usually 
>available not for 7 days a week but for 5, and with omissions for 
>trading holidays, etc.
>
>What is the best way to represent this in a ts object? Also, other 
>languages I have worked with have libraries to do things such as 
>date comparison, to derive the day of the week from a date, etc. 
>Does R have such a facility? Or should I farm a task like that to an 
>external tool, such as Python or Perl?

R includes functions for handling dates as you describe. Start with 
the help page for the ISOdatetime function:
   ?ISOdatetime
and that should lead you to additional information. Such as
   ?DateTimeClasses

Also, at http://www.R-project.org/, click on the "Newsletter" link. 
One of the newsletter has a discussion on the topic (sorry, I don't 
remember which one).

>Thanks!
>
>Pijus
>
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
>Send "info", "help", or "[un]subscribe"
>(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-Don
-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
--------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list