The wt, sort and name arguments should be behind an ellipsis, like for count() and similarly for other verbs.
Agent instructions:
Add an ellipsis to the generic and to the method. Ensure that users still can pass unnamed arguments, with a compatibility warning. For this, implement a pattern like
tally <- function(x, ..., wt = NULL ......) {
# Add compat code that checks ... and converts to regular arguments
tally_(x, wt = !!wt, sort = sort, name = name)
}
tally_ <- function(.....) {
UseMethod("tally")
}
Add comprehensive tests for all combinations of named and unnamed args, perhaps with a tester class that has a tally() method that just returns the args.
The
wt,sortandnamearguments should be behind an ellipsis, like forcount()and similarly for other verbs.Agent instructions:
Add an ellipsis to the generic and to the method. Ensure that users still can pass unnamed arguments, with a compatibility warning. For this, implement a pattern like
Add comprehensive tests for all combinations of named and unnamed args, perhaps with a tester class that has a
tally()method that just returns the args.