Re: [R] R script autoload at startup

From: javier garcia-pintado <>
Date: Mon 27 Feb 2006 - 21:10:54 EST

Thank you very much Prof Brian R,

I also wonder how I missed that.

Anyway, In my .Rprofile file:

>.First <- function() cat ("\n Welcome to R!\n")

works perfectly, while:

>.First <- function() winMenuAdd("Newmenu")

give me the answer:

"Error in .First(): couldn't find function "winMenuAdd"

I just can add the new menu, and create the menu entries later, calling a source() that adds the menus.

Perhaps the functions to add menus to the RGUI are called after the .RProfile is red?

To add it via the .Rprofile would be perfect, but anywat, to be able to create the menu calling manually a source after the GUI is completely started is good enough for me.

Best regards,


El Viernes, 24 de Febrero de 2006 21:12, escribió:
> See ?Startup for how to do this via .Rprofile or etc/
> The answer to your second question is that RGui is not written in tcltk
> (can't you tell from the speed with which it works?), but there are
> documented R functions for you to add menu items, such as winMenuAdd.
> (I do wonder how you missed these in the searches for help, as all the
> terms I tried found the answers.)
> On Fri, 24 Feb 2006, javier garcia-pintado wrote:
> > Yes.
> >
> > It would be nice and useful to save the users the task of loading the
> > source R-TcltK code everytime they start up R. Because, in principle they
> > are going to use R just for this. But the R GUI must remains open
> >
> > Javier
> > -----------------------
> >
> > El Viernes, 24 de Febrero de 2006 16:39, Frank Samuelson escribió:
> >> Do you need the user to interact with the Rgui after the code has run?
> >>
> >> -Frank
> >>
> >> Javier Garcia-Pintado wrote:
> >>> Hello;
> >>> 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,
> >>>
> >>> Javier

javier garcía-pintado

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Mon Feb 27 21:23:37 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:45 EST