Skip to content

[R-pkg-devel] S3 generic/method consistency warning for formula method

1 message · Smith, Brian J

#
Hello all,

I am getting an R CMD check warning about S3 consistency for a formula method of a generic function that dispatches on the ellipsis argument.  The formula method seems to function properly when called, and methods for other types tried do not trigger the warning.  Below is an example generic function 'foo' and methods that will reproduce the issue, followed by the check warning message produced.

foo <- function(...) UseMethod("foo")
foo.factor <- function(...) list(...)
foo.formula <- function(...) list(...)
foo.logical <- function(...) list(...)
foo.matrix <- function(...) list(...)
foo.numeric <- function(...) list(...)

R CMD check warning:

W  checking S3 generic/method consistency (1.7s)
   foo:
     function(...)
   foo.formula:
     function(...)
   
   See section 'Generic functions and methods' in the 'Writing R
   Extensions' manual.

I would appreciate any help in understanding and addressing this check warning.

Thank you,
Brian

*****************************************************************
Brian J Smith, PhD
Professor, Department of Biostatistics
Director, Biostatistics Core, Holden Comprehensive Cancer Center
The University of Iowa
145 North Riverside Drive, N311 CPHB
Phone: 319-384-1587
Email: brian-j-smith at uiowa.edu