Skip to content
Back to formatted view

Raw Message

Message-ID: <p05101003b7de8c88787d@[128.115.153.6]>
Date: 2001-10-01T21:28:29Z
From: Don MacQueen
Subject: Efficiency: as.POSIXct() or ISOdate()
In-Reply-To: <Pine.GSO.4.31.0109301204460.29625-100000@auk.stats>

I am using awk to pre-process several data files that have date-time 
information in a non-standard format. The files can be in the many 
tens of thousands of lines. At present, I plan to use scan(pipe()) or 
perhaps read.table(pipe()) with whatever other arguments are 
necessary.

It occurs to me that using awk I have the opportunity to read the 
datetime information as either a single character vector of datetimes 
and use as.POSIXct() , or as six numeric vectors and use ISOdate().

I would appreciate advice about the relative merits. I would tend to 
prefer the faster one, if there is much difference.

Thanks
-Don

p.s.
I haven't quite sorted out the options, i.e., when to use strftime(), 
when to use format.POSIXct(), when to use as.POSIXct(). At the 
moment, though, I believe I would use as.POSIXct(). I don't at this 
point see any reason to use the "lt" structure in my current 
application.

>  version
          _
platform powerpc-apple-darwin1.3.7
arch     powerpc
os       darwin1.3.7
system   powerpc, darwin1.3.7
status
major    1
minor    3.0
year     2001
month    06
day      22
language R

(and I will probably also use a Solaris version at some point)
-- 
--------------------------------------
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._