s-news
[Top] [All Lists]

Re: Problem with hour 24 vs. hour 0 in timeDate

To: Sarah Henderson <sarah.henderson@ubc.ca>
Subject: Re: Problem with hour 24 vs. hour 0 in timeDate
From: David L Lorenz <lorenz@usgs.gov>
Date: Fri, 15 Jul 2005 10:27:48 -0500
Cc: s-news@lists.biostat.wustl.edu, s-news-owner@lists.biostat.wustl.edu
In-reply-to: <6.0.3.0.2.20050714082503.01f1f190@mail.interchange.ubc.ca>

Sarah,
  It appears that the text should be changed first. The function sedit() in the hmisc library will correctly change the data. I assume that library is available in the student edition.  The correct syntax would be (the $ indicates the end of the string):

sedit(date.time, "24$", "00")

Dave



Sarah Henderson <sarah.henderson@ubc.ca>
Sent by: s-news-owner@lists.biostat.wustl.edu

07/14/2005 11:38 AM

       
        To:        s-news@lists.biostat.wustl.edu
        cc:        
        Subject:        [S] Problem with hour 24 vs. hour 0 in timeDate




Hello to all --

This may be a simple problem but I (as a relatively novice user) cannot
make headway without some help.

I have received several data sets with a character date/time stamp in the
format YYYYMMDDHH where 00:00 to 01:00 on June 1st 2003 would be
represented as 2003053124 instead of 2003060100.  I am trying format this
string as follows for some time-series plotting:


timeDate(date.time, in.format="%4Y%2m%2d%2H", format="%02d %b %Y %02H:%02M")


This works as expected for the 01 through 23 hour values, but I receive NA
for all the 24 hour values which, of course, is not very helpful.  I also
get the message "The time output format specified: 'HH' is invalid. Setting
value to [NONE]."  If anyone can suggest an amendment or a work-around, I
would greatly appreciate it.  I am working on S-PLUS 6.2 (student edition)
in a Windows environment.

Thanks for your attention.

Sarah

______________________________________________

Sarah Henderson
Department of Health Care & Epidemiology
University of British Columbia
Phone: 604.822.1274
Fax: 604.822.9588

Michael Smith Foundation for Health Research Trainee
Canadian Institutes of Health Research Trainee

--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>