Skip to content
Prev 1532 / 21307 Next

[Bioc-devel] no visible binding for global variable message

* On 2008-04-04 at 00:04 +1100 Keith Satterley wrote:
Do you mean that you get no errors when that var is set to false by
any chance?
There's probably a cleaner way to code this now.  I would consider 
creating the environment within your package instead of the global
envirnt.  And mostly for readability, I would not use assignsign() and
get() when working with environments, but instead [[ and <-.  So you
could have:

affylmGUIenvironment <- new.env(hash=TRUE, parent=emptyenv())

Read the help page for details, but generally if you are using an
environment as a hashtable you don't what it to inherit bindings and
parent=emptyenv() is what you want.
These could all be written like:

   affylmGUIenvironment[["Targets"]] <- data.frame()
And this can be written as:

   Targets <- affylmGUIenvironment[["Targets"]]
I think if the affylmGUIenvironment is defined at package scope, as
suggested above, you can define functions that refer to it without
incurring a warning from codetools (untested).
IMO, yes.

It would be highly advisable to add a NAMESPACE file to the package as
well.


+ seth