Using utils::globalVariables to avoid binding errors during R package checking
Asked Answered
E

1

6

I am having trouble with getting rid of a series of "no visible binding" NOTES when I run the R package check for CRAN (on windows 7, Rstudio, R 2.15.3 and Rtools30).

I have already tried the following without succes: - using the recommended utils::globalVariables(c("sig","dat",...etc - NULLing the variables, e.g., sig = NULL; dat = NULL;

What ends up happening is that I get a "cannot change value of locked binding for sig" etc. The code works but it won't be accepted because of these binding errors.

The people at CRAN told me to use: utils::globalVariables(). Where should I place this function?

Evildoer answered 16/3, 2013 at 20:0 Comment(0)
C
7

Add utils::globalVariables(c("obj1", "obj2")) on the very top of the .R file which used these non-binding global variables, such as obj1, obj2.

Ceramal answered 21/3, 2013 at 15:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.