[Rd] inconsistency in POSIXlt

Gabriel Becker gmbecker at ucdavis.edu
Mon Dec 7 22:23:17 CET 2015


I didn't have time to dig through the code completely, but those other two
are being set automatically in the C code as far as I can tell, in
particular in the code

    // localtime may change tzname.
    if (isgmt) {
	PROTECT(tzone = mkString(tz));
    } else {
	PROTECT(tzone = allocVector(STRSXP, 3));
	SET_STRING_ELT(tzone, 0, mkChar(tz));
	SET_STRING_ELT(tzone, 1, mkChar(R_tzname[0]));
	SET_STRING_ELT(tzone, 2, mkChar(R_tzname[1]));

In the file https://svn.r-project.org/R/trunk/src/main/datetime.c
(function do_asPOSIXlt)

R_tzname is an extern char pointer. I can't say exactly where it is
populated, but the code assumes it will be and that it will take care
of what passing a length 3 vector would.

Also, note that AFAICT the second and third are not freeform text,
only very specific values are valid.

Long story short, I think the answer is R doesn't let you do that
because it takes care of it for you. (Unless someone more familiar
with date handling in R pops in and points out how I've completely
missed something).



Gabriel Becker, PhD
Associate Scientist (Bioinformatics)
Genentech Research

	[[alternative HTML version deleted]]

More information about the R-devel mailing list