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



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

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to