Re: [Rd] [R] Date Format

2006-07-12 Thread Prof Brian Ripley
On Wed, 12 Jul 2006, Martyn Plummer wrote: > On Tue, 2006-07-11 at 20:05 +0200, Peter Dalgaard wrote: > > Martyn Plummer <[EMAIL PROTECTED]> writes: > > > > > I moved this to R-devel because I am wondering why the base package does > > > not allow you to convert from numeric to Date. Could we not

Re: [Rd] [R] Date Format

2006-07-12 Thread Martyn Plummer
On Tue, 2006-07-11 at 20:05 +0200, Peter Dalgaard wrote: > Martyn Plummer <[EMAIL PROTECTED]> writes: > > > I moved this to R-devel because I am wondering why the base package does > > not allow you to convert from numeric to Date. Could we not have > > something like this? > > > > as.Date.numeri

Re: [Rd] [R] Date Format

2006-07-11 Thread Peter Dalgaard
Martyn Plummer <[EMAIL PROTECTED]> writes: > I moved this to R-devel because I am wondering why the base package does > not allow you to convert from numeric to Date. Could we not have > something like this? > > as.Date.numeric <- function(x, epoch="1970-01-01", ...) { >if (!is.character(epoc

Re: [Rd] [R] Date Format

2006-07-11 Thread Martyn Plummer
I moved this to R-devel because I am wondering why the base package does not allow you to convert from numeric to Date. Could we not have something like this? as.Date.numeric <- function(x, epoch="1970-01-01", ...) { if (!is.character(epoch) || length(epoch) != 1) stop("invalid epoch")