Hi, anybody know any way to make a bash script to start Rcmdr directly widthout need to open R and execute library(Rcmdr)? I try to make this using R CMD BATCH somethink, but dont find the way. Thanks Ronaldo --> Prof. Ronaldo Reis J?nior| .''`. UNIMONTES/Depto. Biologia Geral/Lab. de Biologia Computacional | : :' : Campus Universit?rio Prof. Darcy Ribeiro, Vila Mauric?ia | `. `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil | `- Fone: (38) 3229-8187 | ronaldo.reis em unimontes.br | chrysopa em gmail.com | http://www.ppgcb.unimontes.br/ | ICQ#: 5692561 | LinuxUser#: 205366
Dear Ronaldo, You should be able to put local({ old <- getOption("defaultPackages") options(defaultPackages = c(old, "Rcmdr")) }) in an .Rprofile file in a directory reserved for this purpose, and have your bash script start R from that directory (untested). See ?Startup for details on how R starts. I hope this helps, John -------------------------------- John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Ronaldo Reis Junior > Sent: March-03-08 8:14 AM > To: R-Help > Subject: [R] Script to start Rcmdr > > Hi, > > anybody know any way to make a bash script to start Rcmdr directly > widthout > need to open R and execute library(Rcmdr)? > > I try to make this using R CMD BATCH somethink, but dont find the way. > > Thanks > Ronaldo > -- > > Prof. Ronaldo Reis J?nior > | .''`. UNIMONTES/Depto. Biologia Geral/Lab. de Biologia Computacional > | : :' : Campus Universit?rio Prof. Darcy Ribeiro, Vila Mauric?ia > | `. `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil > | `- Fone: (38) 3229-8187 | ronaldo.reis at unimontes.br | > chrysopa at gmail.com > | http://www.ppgcb.unimontes.br/ | ICQ#: 5692561 | LinuxUser#: 205366 > > ______________________________________________ > R-help at r-project.org mailing list > 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.
On Mon, 3 Mar 2008, Ronaldo Reis Junior wrote:> Hi, > > anybody know any way to make a bash script to start Rcmdr directly widthout > need to open R and execute library(Rcmdr)? > > I try to make this using R CMD BATCH somethink, but dont find the way.For some reason, Rcmdr requires an interactive session: gannet% Rscript -e 'library(Rcmdr)' Loading required package: tcltk Loading Tcl/Tk interface ... done The Commander GUI is launched only in interactive sessions However, I was able to do gannet% cat foo #!/bin/sh R_DEFAULT_PACKAGES=Rcmdr R Probably you need R in interactive mode to respond to the Tcl/Tk callbacks (and not just terminate when no input is found). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On Mon, Mar 03, 2008 at 10:13:53AM -0300, Ronaldo Reis Junior wrote:> Hi, > > anybody know any way to make a bash script to start Rcmdr directly widthout > need to open R and execute library(Rcmdr)? > > I try to make this using R CMD BATCH somethink, but dont find the way.$ r -lRcmdr -e'while(TRUE) Sys.sleep(1)' where r is the binary from our littler tool. This loads the Rmcdr package with the -l | --library switch abnd then evals a simple loop to keep running. You need to kill that loop with Crtrl-c at the end. Dirk -- Three out of two people have difficulties with fractions.