[Rd] pretty.Date(): new "halfmonth" time step

Felix Andrews felix at nfrac.org
Wed May 19 04:41:27 CEST 2010


Hi R-devel / R-core

In the new pretty() methods for Date and POSIXct
https://svn.r-project.org/R/trunk/src/library/grDevices/R/prettyDate.R
there is currently a "pretty" time step listed as "15 DSTdays"... but
this actually doesn't line up well with months.

Much better to implement directly what this is trying to do: i.e. to
have a "halfmonth" time step. This is just the union of two "monthly"
sequences, one on the 1st of each month and another on the 15th of
each month.

With this in place we have:

prettyDate(as.Date(c("2002-02-02", "2002-05-01")))
# [1] "2002-02-15" "2002-03-01" "2002-03-15" "2002-04-01" "2002-04-15"
"2002-05-01"

The proposed patch is attached.

Regards
-Felix


-- 
Felix Andrews / 安福立
Postdoctoral Fellow
Integrated Catchment Assessment and Management (iCAM) Centre
Fenner School of Environment and Society [Bldg 48a]
The Australian National University
Canberra ACT 0200 Australia
M: +61 410 400 963
T: + 61 2 6125 4670
E: felix.andrews at anu.edu.au
CRICOS Provider No. 00120C
-- 
http://www.neurofractal.org/felix/


More information about the R-devel mailing list