Tools for Working with ...
In S3 generics, it's useful to take ... so that methods can
have additional argument. But this flexibility comes at a cost: misspelled
arguments will be silently ignored. The ellipsis packages is an experiment
that allows a generic to warn if any arguments passed in ... are not
... to an S3 generic allows methods to take additional
arguments, but it comes with a big downside: any mispelled or extraneous
arguments will be silently ignored. This package explores an approach to
... safer, by supply a function that a generic can use to warn
if any elements of
... were not evaluated.
In the long run, this code is likely to live elsewhere (maybe R-core might be interested in making it part of base R). This repository tracks the current state of the experiment.
safe_median() works like
median() but warns if any elements of
are never evaluated
library(ellipsis) x <- c(1:10, NA) safe_median(x) #>  5.5 safe_median(x, TRUE) #> Warning: Some components of ... were not used: ..1 #>  5.5 safe_median(x, na.rm = TRUE) #>  5.5 safe_median(x, na.mr = TRUE) #> Warning: Some components of ... were not used: na.mr #>  5.5
Functions in ellipsis
|check_dots_used||Check that all dots in current environment have been used|
|safe_median||Safe version of median|
Last month downloads
|Packaged||2018-08-28 18:50:17 UTC; hadley|
|Date/Publication||2018-08-31 19:50:03 UTC|
Include our badge in your README