[R] Dates and times from Excel
ggrothendieck at gmail.com
Mon Feb 23 02:31:54 CET 2009
The chron package stores times as a fraction of the day. See R News 4/1.
On Sun, Feb 22, 2009 at 8:26 PM, David Scott <d.scott at auckland.ac.nz> wrote:
> I have used xlsReadWrite to read data from an Excel spreadsheet.
> I had a problem with converting times of the day so that I could create
> POSIXct date-time objects. I was wondering if there was a better solution.
> Excel stores times of the day as fractions of a day so I wrote a function to
> convert the fraction to a number of seconds, extract the hours, minutes and
> seconds and output it in ISO standard format (%H:%M:%S).
> Given a date obtained from an Excel date using as.Date I could then make up
> my POSIXct date-time objects.
> This seems like it would be such a standard operation that there may be
> existing solutions that I have missed.
> Any comments, advice?
> David Scott
> David Scott Department of Statistics
> The University of Auckland, PB 92019
> Auckland 1142, NEW ZEALAND
> Phone: +64 9 373 7599 ext 85055 Fax: +64 9 373 7018
> Email: d.scott at auckland.ac.nz
> Graduate Officer, Department of Statistics
> Director of Consulting, Department of Statistics
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help