@@ -97,7 +97,7 @@ hist.default <-
9797 nB <- as.integer(nB )
9898 if (is.na(nB )) stop(" invalid length(breaks)" )
9999
100- # # Do this *before* adding fuzz or logic breaks down. ..
100+ # # Do this *before* adding fuzz or logic breaks down ..
101101
102102 h <- as.double(diff(breaks ))
103103 equidist <- ! use.br || diff(range(h )) < 1e-7 * mean(h )
@@ -145,18 +145,25 @@ hist.default <-
145145 }
146146 else { # # plot is FALSE
147147 if (warn.unused ) {
148- # # make an effort to warn about "nonsensical" arguments:
148+ # # make an effort to warn about "nonsensical" arguments, notably those only in plot(.) above
149149 nf <- names(formals()) # # all formals but those:
150150 nf <- nf [is.na(match(nf , c(" x" , " breaks" , " nclass" , " plot" ,
151151 " include.lowest" , " right" , " fuzz" )))]
152152 missE <- lapply(nf , function (n )
153153 substitute(missing(. ), list (. = as.name(n ))))
154154 not.miss <- ! vapply(missE , eval , NA , envir = environment())
155+ nf <- nf [not.miss ]
156+ nnmiss <- sum(not.miss )
157+ if (any(iM <- nf == " ..." )) { # replace "..." with arg names in `...`
158+ dnms <- ... names()
159+ nf <- c(nf [! iM ], dnms )
160+ nnmiss <- nnmiss - 1L + length(dnms )
161+ }
155162 if (any(not.miss ))
156- warning(sprintf(ngettext(sum( not.miss ) ,
163+ warning(sprintf(ngettext(nnmiss ,
157164 " argument %s is not made use of" ,
158165 " arguments %s are not made use of" ),
159- paste(sQuote(nf [ not.miss ] ), collapse = " , " )),
166+ paste(sQuote(nf ), collapse = " , " )),
160167 domain = NA )
161168 }
162169 r
0 commit comments