问题
In the CRAN repository policy documentation, it is explicitly stated: "Packages should not modify the global environment (user’s workspace)."
When I run
R CMD check
via
devtools::check(),
it merely states "no visible binding for global variable x." as a NOTE rather than a WARNING.
CRAN will not accept user-contributed packages containing ERRORS and/or WARNINGS. My package has none of these. NOTES, on the other hand, are admissible.
This said, I have a few
assign(..., envir = .GlobalEnv)
instances in a function within my R package which I intend to submit to CRAN.
Given that globals are frowned upon, the following questions arise:
(1) Why doesn't R CMD check issue WARNINGS regarding global variables?
(2) Will the CRAN maintainers complain to me regarding the use of globals in my package?
来源:https://stackoverflow.com/questions/55604073/cran-policy-on-use-of-global-variables