I have a function shift defined as:
require(plyr)
shift <- function(x,...) {
UseMethod("shift",x)
}
shift.default <- function(x,n=1,wrap=TRUE,pad=FALSE,...) {
# innards
return(0)
}
shift.data.frame <- colwise(shift.default)
It works just fine, until I put it in a package and try R CMD check. Then I get a warning while checking S3 generic/method consistency. It reports that shift.data.frame and shift don’t agree:
shift(x,...)
shift.data.frame(df,...)
I assume this results from x and df not matching. Any convenient way to fix this?
Does something like this work?