You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internal exportGlobals() should make sure global object actually lives in package before dropping it. This would for instance avoid dropping FUN in if it is assigned as FUN <- base::mean in, say, the global environment.
Currently, exportGlobals() is a bit naive and just trusts the environment of the object;
pkgs<- packagesOf(globals)
## Drop all globals which are already part of one of## the packages in 'pkgs'. They will be available## when those packages are attached.pkgsG<- sapply(globals, FUN=function(obj) {
environmentName(environment(obj))
})
keep<-!is.element(pkgsG, pkgs)
globals<-globals[keep]
As a start it should make sure the name (by names(globals)) matches.
Internal
exportGlobals()
should make sure global object actually lives in package before dropping it. This would for instance avoid droppingFUN
in if it is assigned asFUN <- base::mean
in, say, the global environment.Currently,
exportGlobals()
is a bit naive and just trusts the environment of the object;As a start it should make sure the name (by
names(globals)
) matches.Related to: Issue HenrikBengtsson/globals#9
The text was updated successfully, but these errors were encountered: