Skip to content

R script autoload at startup

4 messages · Brian Ripley, Javier Garcia-Pintado

#
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??:

  
    
#
See ?Startup for how to do this via .Rprofile or etc/Rprofile.site.

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:

            

  
    
2 days later
#
Thank you very much Prof Brian R,

I also wonder how I missed that.

Anyway, In my .Rprofile file:
works perfectly, while:
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,

Javier

El Viernes, 24 de Febrero de 2006 21:12, escribiÃ³:

  
    
#
On Mon, 27 Feb 2006, javier garcia-pintado wrote:

            
You need to specify the package at that point, as when .First is run the 
default packages are not yet loaded (see ?Startup for the precise 
description).  E.g. (untested, as I am using Linux)

.First <- function() utils::winMenuAdd("Newmenu")