How to solve devtools::check() NOTE on Non standard evaluation of foreach iterator when writing R packages?

35 Views Asked by At

I'm finishing up writing a package to submit to CRAN and I'm working on purging all of the NOTEs in devtools::check(). Currently I only have a note on non-standard evaluation left to figure out, specifically:

no visible binding for global variable ‘i’

which seems to be related to my use of foreach() in the package where i is the foreach iterator. What is the standard evaluation solution to the non-standard evaluation iterator i?

My first idea was to substitute i for .data$i as you would when replacing non-standard evaluation when programming with dplyr, but this did not work. I could use utils::globalVariables() but this feels like cheating (plus does not seems safe for a variable name as generic as i)

0

There are 0 best solutions below