An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20040128/9bddef20/attachment.pl
Julian Dates
2 messages · Massimiliano Tripoli, PIKAL Petr
Hallo
On 28 Jan 2004 at 13:13, Massimiliano Tripoli wrote:
Hi all, I have problems with dates format using "chron" package. I don't understand why R by this istruction:
dates("01/02/29",out.format="d/m/year")
[1] 02/Jan/2029
Well, the result probably depends on your system and locale setting.
I would use 4 digit year.
You can use ifelse construction to compute 4 digit years and then you have to
reconstruct your dates vector probably with paste and as.character.
ifelse(as.numeric(substr("01/02/06",7,8))>5,
as.numeric(substr("01/02/06",7,8))+1900,
as.numeric(substr("01/02/06",7,8))+2000)
Cheers
Petr
dates("01/02/30",out.format="d/m/year")
[1] 02/Jan/1930 reads "29" as 2029 and "30" as 1930. How could I set the istruction in order to read years from "00" to "05" as 2000 to 2005 and "06" to "99" as 1906 to 1999 ? Thank you Dott. Massimiliano Tripoli Dipartimento di Scienze Biomediche e Biotecnologie Sezione di Statistica Medica e Biometria Universit? di Brescia tel. +39-030-3717467 fax +39-030-3701157 [[alternative HTML version deleted]]
______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Petr Pikal petr.pikal at precheza.cz