hello Is it possible to execute Unix command from R prompt? for example ls cd .. In matlab this possible by adding "!" !ls !cd .. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Try something like: R>system("ls") Anders On Mon, 6 Nov 2000, Meriema Belaidouni wrote:> hello > Is it possible to execute Unix command from R prompt? > for example > ls > cd .. > > In matlab this possible by adding "!" > !ls > !cd .. >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Meriema Belaidouni <meriema at info.univ-angers.fr> writes:> ls > cd .. > > In matlab this possible by adding "!" > !ls > !cd ..Use system("ls"). We've had the "!" convention at some point, but as I remember it, people got tired of having it kick in unexpectedly where logical "not" was intended, and we decided that it was probably a bad idea to have a syntactically correct R expression do something completely different when it happened to sit at the beginning of a line... -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Meriema Belaidouni <meriema at info.univ-angers.fr> writes:> hello > Is it possible to execute Unix command from R prompt? > for example > ls > cd ..system("ls") [...] Cheers Ross Darnell -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Yes, you can use this: system("date > date.txt") for example Meriema Belaidouni wrote:> > hello > Is it possible to execute Unix command from R prompt? > for example > ls > cd .. > > In matlab this possible by adding "!" > !ls > !cd .. > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-- Olivier Houix <houix at ircam.fr> tel: 01 44 78 15 51 Equipe Perception et Cognition Musicales http://www.ircam.fr/ IRCAM 1 place Igor Stravinsky 75004 Paris -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 7 Nov 2000, Mark Myatt wrote:> Yves Gauvreau <cyg at sympatico.ca> writes: > >... and Matlab uses "ans" and Mathematica effectively uses %, %% > > > >Would be nice to have something simpler than .Last.value > > Perhaps I am stating the obvious or being extremely stupid but you can > create a function: > > lv <- function() > { > .Last.value > } > > And then use lv() whenever you need .Last.value.How do you say "give me the output I saw three steps ago?" In Mathematica you would use %%% or Out[-3]. Bill -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
ben at zoo.ufl.edu writes:> > [stack implementation] > > But if I could remember to push() every time I could remember to assign >everything to temporary variables anyway ...I suppose so. It might be possible to do an automatic push() on any assignment but that would create an enormous stack just retrieving a dataset or fitting a model. Mark -- Mark Myatt -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._