[R-pkg-devel] Functions erroneously identified as S3 methods

John Reid john.reid at mrc-bsu.cam.ac.uk
Mon Jul 3 12:53:39 CEST 2017


Hi,

I have some functions in my package that are getting confused for S3 
methods. I named them `filter.genes` and `filter.cells` which in 
hindsight looks like a mistake as `filter` is a S3 method.

When I submit my package I receive a WARNING:

* checking S3 generic/method consistency ... WARNING filter: function(x, 
filter, method, sides, circular, init) filter.cells: function(dl, 
.filter, number, cells) filter: function(x, filter, method, sides, 
circular, init) filter.genes: function(dl, .filter, number, genes) See 
section ‘Generic functions and methods’ in the ‘Writing R Extensions’ 
manual. Found the following apparent S3 methods exported but not 
registered: filter.cells filter.genes See section ‘Registering S3 
methods’ in the ‘Writing R Extensions’ manual.

I have deprecated the functions and replaced them with versions named 
with underscores but do not want to remove them until a later release. 
However I received a `pre-test archived` email from the CRAN team:

package DeLorean_1.2.5.tar.gz does not pass the incoming checks automatically, please see the pre-test at:
<https://win-builder.r-project.org/incoming_pretest/170703_114446_DeLorean_125/00check.log>
Status: 1 WARNING, 1 NOTE
  
Current CRAN status: WARN: 11, OK: 1
See:<https://CRAN.R-project.org/web/checks/check_results_DeLorean.html>
  
Please fix all problems and resubmit a fixed version via the webform.
If you are not sure how to fix the problems shown, please ask for help on the R-package-devel mailing list:
<https://stat.ethz.ch/mailman/listinfo/r-package-devel>
If you are fairly certain the rejection is a false positive, please reply-all to this message and explain.
  
More details are given in the directory:
<https://win-builder.r-project.org/incoming_pretest/170703_114446_DeLorean_125>
The files will be removed after roughly 7 days.


How should I proceed?

FWIW here is the Roxygen documenation for one of the functions:

#' Filter genes
#'
#' @param dl de.lorean object
#' @param .filter Function that gakes a list of genes as input and returns
#'     a vector of TRUE/FALSE
#' @param number Number to sample if filter function or genes not supplied.
#' @param genes The genes to keep.
#' @examples
#' \dontrun{
#' genes <- c('NANOG', 'DAZ1', 'SOX4', 'PRDM14')
#' filter.genes(dl, .filter = function(x) x %in% genes)
#' filter.genes(dl, number = 4)
#' filter.genes(dl, genes = genes)
#' }
#'
#' @export filter.genes
#'

Thanks,
-- 
John Reid <http://johnreid.github.io>
MRC Biostatistics Unit
Cambridge, UK
Twitter: @__Reidy__ <https://twitter.com/__Reidy__>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list