[R-pkg-devel] Visible bindings and reference classes

Colin Gillespie csgillespie at gmail.com
Mon Aug 10 22:33:32 CEST 2015


Dear All,

I have a package that uses reference classes. When I build the package I
get numerous notes of the sort

Note: no visible binding for '<<-' assignment to 'pars'

I've tried using GlobalVariables, but that didn't solve the issue.

After some googling, I came across the page
http://stackoverflow.com/q/23475309/203420 which suggests

suppressBindingNotes <- function(variablesMentionedInNotes) {
  for(variable in variablesMentionedInNotes) {
    assign(variable,NULL, envir = .GlobalEnv)
  }
}
suppressBindingNotes(c("dat", "internal", "xmin", "pars", "no_pars"))

But checking the package with --as-cran raises the note

* checking R code for possible problems ... NOTE
Found the following assignments to the global environment:
  File ‘poweRlaw/R/aaa_all_classes.R’:
  assign(variable, NULL, envir = .GlobalEnv)

What is the correct way of removing the "visible bindings" notes?

Thanks

Colin

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list