[R] send commands from script to console

Greg Snow Greg.Snow at imail.org
Thu Jan 13 21:19:31 CET 2011

In the windows GUI cntrl+r will send the current line or selection to the command line.  There is not a similar sequence to send from the command line to a script, but you can use the "history" function to create a new script from the recent commands (you can set how many).

Another option is ?txtStart in the TeachingDemos package which can be used to create a script (in a file) with all the commands you issue (well the ones that don't result in an error) going forward.

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of gaiarrido
> Sent: Thursday, January 13, 2011 1:04 PM
> To: r-help at r-project.org
> Subject: [R] send commands from script to console
> Hi,
> I'm working with R in windows and I wonder if there is any command (of
> the
> kind CTRL+ ) to transfer the commands I've worked with (like: >
> model<-glm(prevalencia~edadysexo*mes*zona,binomial)) to a script
> automatically, without the results I received from R after execute
> them.
> Another question, what's the combination of CTRL+ for transfer the
> orders in
> the other way, fom the script to the console?
> Thanks very much
> Sorry for the explanation, but I don't know the generic names of each
> kind
> of commands
> -----
> Mario Garrido Escudero
> PhD student
> Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca.
> Agrícola
> Universidad de Salamanca
> --
> View this message in context: http://r.789695.n4.nabble.com/send-
> commands-from-script-to-console-tp3216553p3216553.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> 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.

More information about the R-help mailing list