Bjarke,

I had sent you a minimal diff that silenced R CMD check after you replied to
me off-list; if it were my package I'd stop there.

But you can of course continue to insist that you should be allowed to have a
local, internal filtering function -- and "yes you can". But the common
(documented) trick is to use _an internal function_ differentiated with a
leading dot, i.e. `.filter()`.  So with the diff below I once again only have
a warning from your class being undocumented. That R6 needs to be imported
seems par for the course; Michael rightly suggested that you could patch
`codetools` if it really bugs you.

Cheers, Dirk

edd@paul:/tmp/r/RCMDcheckFalsePositive(main)$ git diff
diff --git i/NAMESPACE w/NAMESPACE
index dbd6067..817a7ee 100644
--- i/NAMESPACE
+++ w/NAMESPACE
@@ -1 +1,2 @@
 export(DataProcessor)
+import(R6)
diff --git i/R/hello.R w/R/hello.R
index a608963..85befc4 100644
--- i/R/hello.R
+++ w/R/hello.R
@@ -1,4 +1,4 @@
-filter <- function() {
+.filter <- function() {
   message("This is a custom filter function.")
 }
 
@@ -9,7 +9,7 @@ DataProcessor <- R6::R6Class(
     initialize = function(data) self$data <- data,
 
     filter_data = function(data) {
-      filter()
+      .filter()
       self$data <- stats::filter(self$data, rep(1, 3))
     }
   )
edd@paul:/tmp/r/RCMDcheckFalsePositive(main)$ 
-- 
dirk.eddelbuettel.com | @eddelbuettel | [email protected]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to