Why is there no is.Date function in R? I am running 2.1.1 does it exist in newer version? If there is a reasoning behind the lack of a is.Date function what is it? Thanks Charles -- Charles Dupont Computer System Analyst School of Medicine Phone: (615) 936-6510 Department of Biostatistics Vanderbilt University
Try this:> is(Sys.Date(), "Date")[1] TRUE> is(33, "Date")[1] FALSE> inherits(Sys.Date(), "Date")[1] TRUE> inherits(33, "Date")[1] FALSE> R.version.string[1] "R version 2.2.0, 2005-09-20" On 9/26/05, Charles Dupont <charles.dupont at vanderbilt.edu> wrote:> Why is there no is.Date function in R? I am running 2.1.1 does it exist > in newer version? If there is a reasoning behind the lack of a is.Date > function what is it? > > Thanks > > Charles > > > -- > Charles Dupont Computer System Analyst School of Medicine > Phone: (615) 936-6510 Department of Biostatistics Vanderbilt University > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
inherits(object, "Date") is all that is required. We don't need to complicate R with such simple functions. On Mon, 26 Sep 2005, Charles Dupont wrote:> Why is there no is.Date function in R? I am running 2.1.1 does it exist > in newer version? If there is a reasoning behind the lack of a is.Date > function what is it? > > Thanks > > Charles > > > -- > Charles Dupont Computer System Analyst School of Medicine > Phone: (615) 936-6510 Department of Biostatistics Vanderbilt University > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595