[R] R script autoload at startup

Nick Drew ndrew at efn.org
Sat Mar 4 14:59:24 CET 2006

Regarding question #2:

You can write a package that attaches a menu if using Rgui on Windows.

For example, I use something like this in one of my packages:

## --------------------------------------------------------------
.onAttach <- function(...){

    cat("You have loaded COREtools, version",
packageDescription("COREtools", fields = "Version"), "\n")

	if ("RTerm" %in% .Platform$GUI)
		cat("COREtools menu not available in Rterm\n")

	on.exit(if("Rgui" %in% .Platform$GUI) COREtoolsMenu())


## --------------------------------------------------------------

Then I put my menu code in a function called 'COREtoolsMenu'.

This works well for me.


-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Javier
Sent: Friday, February 24, 2006 2:01 AM
To: r-help at stat.math.ethz.ch
Subject: [R] R script autoload at startup

I'm now using mainly R for windows, mainly because I'm writing a
tcl/Tk interface for some people, and I've got two questions. I'm an
absolute beginner with tctk or tcktk use under the R GUI.

1) Is it posible to create a shorcut that launchs the R GUI and
automatically reads the "source code" of the tcl/tk script to also
launch the tcltk interface?

2) Is the RGUI programmed with tcltk? In this case, is it possible
for an user like me to create a menu entry at the R GUI to call the
source code in this R/tcl/Tk script?

Any of the two options would be very good for us.

Thanks and best regards,


R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide!

More information about the R-help mailing list