[Rd] Patch for hist.Date() function in datetime.R

Marc Schwartz marc_schwartz at me.com
Fri Apr 22 20:24:33 CEST 2011


Hi all,

In follow up to my reply to Terry Therneau on r-help regarding the lack of a check in hist.Date() for a missing 'breaks' argument, attached is a proposed patch which includes such a check, patterned after the same check for hist.POSIXt().

The patch is against the current svn 'trunk' version of datetime.R in package 'graphics'.

Regards,

Marc Schwartz



--- datetime.R	2011-04-22 13:04:29.000000000 -0500
+++ datetime.R.new	2011-04-22 13:18:10.000000000 -0500
@@ -237,6 +237,8 @@
     force(xlab)
     incr <- 1
     ## handle breaks ourselves
+    if(missing(breaks))
+	stop("Must specify 'breaks' in hist(<Date>)")    
     if (inherits(breaks, "Date")) {
         breaks <- as.Date(breaks)
         d <- min(abs(diff(unclass(breaks))))



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20110422/2be8ef82/attachment.txt>
-------------- next part --------------




More information about the R-devel mailing list