From marc_schwartz at me.com  Fri Apr 22 20:24:33 2011
From: marc_schwartz at me.com (Marc Schwartz)
Date: Fri, 22 Apr 2011 13:24:33 -0500
Subject: [Rd] Patch for hist.Date() function in datetime.R
Message-ID: <6DF3F671-849D-48A9-8E2C-F0CE85D3A3A4@me.com>

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 --------------




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