Hi I have a package with a functions that makes a gui with gWidgets, is there a way I can get this to be executed on package load so the interface comes up straight away.
I thought something like this:
.OnAttach <- function(libname, pkgname){
gui()
}
would work, but I'm still learning about hooks, and the events during package load and unload, and R environment stuff.
EDIT:
This is what I currently have in my zzz file:
.onLoad <- function(libname = find.package("GspeEaR"), pkgname = "GspeEaR") {
gui()
}
Thanks,
Ben W.
I think you want .onLoad
which you dump in a .R file called zzz.R (traditionally). Here's an example where I've used this: github.com/trinker/gmailR/blob/master/R/zzz.R
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With