Dear All, I am writing a GUIpackage that needs global variables. I had many warning message when I checked the code as for example: geteSet: no visible binding for global variable ‘curselectCases’ I would like to write a function that creates a global place for Objects to be loaded as:
Fun <- function(){ Object <- 5 Var2Global <- function(Object){ .myDataEnv <- new.env(parent=emptyenv()) # not exported isLoaded <- function(Object) { exists(Object, .myDataEnv) } getData <- function(Object) { if (!isLoaded(Object)) data(Object, envir=.myDataEnv) .myDataEnv[[Object]] } } } To avoid the use of: Object <<- 5 but it seems not working yet. Object == 5 is not a global variable after running Fun(). Any Idea? Thanks Ô__ c/ /'_;~~~~kmezhoud (*) \(*) ⴽⴰⵔⵉⵎ ⵎⴻⵣⵀⵓⴷ http://bioinformatics.tn/ [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.