There are two articles describing time and date classes in the R-News letter:
Brian D. Ripley and Kurt Hornik. Date-time classes. R News, 1(2):8-11, June 2001. http://cran.r-project.org/doc/Rnews/Rnews_2001-2.pdf Gabor Grothendieck and Thomas Petzoldt. R help desk: Date and time classes in R. R News, 4(1):29-32, June 2004. http://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf The Ripley and Hornik article discusses the "POSIXt" (Posix time) classes: "POSIXlt" (POSIX local time) and "POSIXct" (POSIX calendar time). The Grothendieck and Petzoldt article discusses the "Date", "chron" and "POSIXt" classes, and has a very helpful table of how to do various operations on "Date", "chron" and "POSIXct" objects. There is also the fCalandar package, which includes a timeDate class and has support for holidays, operations on timeDate objects, and various other features useful for dealing with times and dates as they are used in financial data. Obviously, there is the online help for the fCalendar package, but there are also three other documents describing how to work with timeDate objects: Computing with R and S-Plus For Financial Engineers 1 - Part I - Markets, Basic Statistics, Date and Time Management, Diethelm W¨urtz http://www.itp.phys.ethz.ch/econophysics/R/docs/fBasics.pdf R and Rmetrics for Teaching. Financial Engineering and Computational Finance, Part II, Dates, Time, and, Calendars, Diethelm W¨urtz http://www.itp.phys.ethz.ch/econophysics/R/docs/rCalendar.pdf S4 ’timeDate’ and ’timeSeries’ Classes for R, Diethelm W¨urtz http://www.itp.phys.ethz.ch/econophysics/R/pdf/calendar.pdf -- Tony Plate Michael Toews wrote: > Sadly, I don't know of any tutorials or much help on the web for R ... > that doesn't mean it doesn't exist ... you might just have to look > around for it (www.rseek.org is a good place to start) > I've learned almost everything I know through: > ?strptime > > Also check out the methods for the classes, for example: > > methods(class="Date") > methods(class="POSIXct") > > And certainly check their help pages ... there is loads of stuff here > that I haven't discovered myself. (Note, if you are new to S3 classes .. > if it begins with the method, then "." class, you only need to type the > beginning. For example "summary(ymd)" ... not "summary.Date(ymd)" if > "ymd" has `class(ymd) == "Date" `. > > I think the fundamental things to know are there are three main > DateTimeClasses: > > 1. "POSIXct" - has date, time and optionally time-zone info -- very > handy for using in data.frame objects (and frankly I think it > should be renamed to "DateTime" since the class "POSIXct" has > nothing really to do directly with date/times) > 2. "POSIXlt" - as far as I'm concerned, this is has the same > functionality as "POSIXct", but it cannot be used in data.frame > objects (and frankly, I think it should be deprecated in favour of > #1 to reduce future confusion) > 3. "Date" - use this if you don't care about times or time-zones > > But it would be nice to track down a good tutorial somewhere. > +mt > > Young Cho wrote: >> Thanks so Michael! If you know of a tutorial or introductory document >> about timeDate manipulation or time series manipulation in R, can you >> share it? It is hard to find by googling... I'd very appreciate any >> advice. > > ______________________________________________ > R-help@stat.math.ethz.ch 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. > ______________________________________________ R-help@stat.math.ethz.ch 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.