Is it difficult in R to create a function calling system() with user's inputs iteratively?
Daehyok Shin (Peter) > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Prof Brian Ripley > Sent: Thursday, June 24, 2004 PM 2:28 > To: Shin, Daehyok > Cc: R, Help > Subject: Re: [R] system shell emulation in R > > > On Thu, 24 Jun 2004, Shin, Daehyok wrote: > > > Rather than using system() to execute a shell command, > > is there a way to emulate the system shell itself in R? > > For instance, if the function is shell, > > > > > getwd() > > [1] "/home/a/b" > > > shell() # From R to system shell > > $cd .. # cd command in system shell > > $CTRL+D # Return to R > > > getwd() > > [1] "/home/a" > > system("/bin/sh") does this for you under a Unix-alike. But as spawning a > shell as cd-ing in the child does not change the working directory of the > parent, the emulation would be imperfect if this worked in R. > > Do try it in your favourite shell! > > -- > Brian D. Ripley, [EMAIL PROTECTED] > 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 > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
