[Rd] time_t handling in R

Thomas Lumley tlumley at u.washington.edu
Wed Sep 27 16:24:42 CEST 2006

On Wed, 27 Sep 2006, Tom McCallum wrote:

> Hello all,
> I am converting some C code into a package for R and wondered what the
> proper way of handling time_t types from C in R was.  time_t is a typedef
> for long, but R seems to only deal in Integers or Reals, so what is the
> proper way of handling time in an R to C conversion ( or visa versa )?

time_t is not portably a typedef for long, or even for an integer type 
(according to the C standard).  If it is an integer type on your system 
then you can pass it as a vector of integer (and on many systems long and 
int are the same so one integer will suffice)


More information about the R-devel mailing list