[R] reading dates

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jan 16 07:31:58 CET 2002


On Tue, 15 Jan 2002, Suchandra Thapa wrote:

>     Is there any simple way of reading dates from a file?  I'm currently
> reading dates in as characters and then converting them to POSIXlt objects.
> However I would like to know if there is a way of having read.table or scan
> convert a field to a date-time class.

scan, no.
read.table, in principle in >=1.4.0, see the colClasses argument.

There are so many possible formats of dates that any attempt to automate
this is bound to lead to problems.

`In principle' because you need to set up as() to do the conversion (and
that is part of the methods package and not set up out-of-the-box).

What's the problem with what you are doing now?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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