Re: [R] reading dates

About this list Date view Thread view Subject view Author view Attachment view

From: Prof Brian Ripley (ripley@stats.ox.ac.uk)
Date: Wed 16 Jan 2002 - 17:31:58 EST


Message-id: <Pine.LNX.4.31.0201160626160.25451-100000@gannet.stats>

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@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@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Thu 17 Jan 2002 - 11:10:11 EST