From Phil.Lee at morganstanley.com  Wed Sep 17 19:24:27 2008
From: Phil.Lee at morganstanley.com (Lee, Philip (IT))
Date: Wed, 17 Sep 2008 13:24:27 -0400
Subject: [Rd] Dates in C api
Message-ID: <575EAD86322DA342B50FE422364A9F52082D528B@NYWEXMB27.msad.ms.com>

r-devel,

I've been trying to write a C plugin for R, and I'm struggling to
understand how dates are represented.

I can create a date in R:
> mydate<-as.Date(1, origin="1900-01-01") mydate
[1] "1900-01-02"

When I pass my date to a plugin, though, it's type is that of a real.
There doesn't seem to be a date type in Rinternals.h, is there a way to
recognize that a value is a date rather than a real?

Equally, does anyone know if it's possible to create date values in the
C api?

Thanks,
Phil Lee

Philip Lee
Morgan Stanley | Technology
750 Seventh Avenue, 12th Floor | New York, NY  10019
Phil.Lee at morganstanley.com
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.



[Rd] Dates in C api
Lee, Philip (IT