[R] Handling dates

From: Göran Broström <gb_at_stat.umu.se>
Date: Fri 19 Aug 2005 - 20:14:10 EST


I have a problem with some functions handling dates, in packages 'date' and 'survival' (they seem to be identical). For instance, from the documentation,



mdy.date {survival}

R Documentation

Convert to Julian Dates

Description

Given a month, day, and year, returns the number of days since January 1, 1960. Usage

mdy.date(month, day, year, nineteen = TRUE, fillday = FALSE,

         fillmonth = FALSE)



but

> library(survival)
> mdy.date(12, 1, 1977)

[1] 1Dec77

Similar strange results appear in other date-related functions. I plan to write functions that converts, eg, "1977-01-31" to the real number 1977.084 and back. What function in R does what 'mdy.date' claims to do?

I'm on   

platform i686-pc-linux-gnu

arch     i686
os       linux-gnu

system i686, linux-gnu
status
major 2
minor 1.1
year 2005
month 06
day 20
language R
-- 
Göran Broström                    tel: +46 90 786 5223
Department of Statistics          fax: +46 90 786 6614
Umeå University                   http://www.stat.umu.se/~goran.brostrom/
SE-90187 Umeå, Sweden             e-mail: gb@stat.umu.se

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Aug 19 20:48:10 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:54 EST