s-news
[Top] [All Lists]

Date conversions

To: s-news@lists.biostat.wustl.edu
Subject: Date conversions
From: jefe goode <jefe_goode@yahoo.com>
Date: Tue, 20 Sep 2005 15:45:55 +0100 (BST)
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=AwcDhoVz2luS7OgEYO78loTVQfC9A4hZN+i2R6w+RlL5vWO8MxmpFqkJKXU2xpNNc0mvjsgSwQgVCIvheytcfoLc9VygHr5pgshrJJYgddVavLYsCKWPSEPJo0kZ47pgiw2oRfQwW3ZXClSSl4YvaDQL5/FSkJgOXJbW16vzosU= ;
S+ is giving me a strange error in some previously
working code (simple code).

cat("\n Time conversion from dd/mm/year to dd-mon-yy
\n")
MyTime  <- as.character(MyTime)
cat("\n --- MyTime --- \n")
print(MyTime[1:10])
cat("\n")
MyTime  <- dates(MyTime, format="dd/mm/year",   
out.format="dd-mon-yy")
MyTime  <- as.character(MyTime) 

The data MyTime is printed as:
 --- MyTime --- 
 [1] "09/09/2005" "08/09/2005" "07/09/2005"
"06/09/2005" "05/09/2005" "04/09/2005" "03/09/2005"
 [8] "02/09/2005" "01/09/2005" "31/08/2005"

whereas S+ is claiming it is seeing mm/dd/year 

the exact error message is:
1: wrong number of fields in entry(ies) 1, 2 in:
unpaste(dates., sep = fmt$sep, fnames =
        fmt$periods, nfields = 3)
2: 2701 missing values generated coercing from
character to numeric in: as.numeric(out$y)
Problem in convert.dates(dates., format = fmt, origin
= origin..: format mm/dd/year may be
        incorrect


Are there any global flags which could result in this
error?
The MyTime variable originally derives from an excel
file and this code has regularly worked previously,
further restarting S+ results in the same error
messages.

Any help appreciated

TIA

Jefe


        
        
                
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com

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