Hi all, Is there any documentation on running R like one would run a shell or Perl script, with out/input directed appropriately, environment variable access, and command switch processing? I looked some, and even remembered to check the FAQ, but couldn't find anything. Thanks W
Someone had modified the R source to handle this, but it has not been incorporated into the official R source, if I'm not mistaken. Search the R-devel archive. HTH, Andy> From: Webb Sprague > > Hi all, > > Is there any documentation on running R like one would run a shell or > Perl script, with out/input directed appropriately, > environment variable > access, and command switch processing? > > I looked some, and even remembered to check the FAQ, but > couldn't find > anything. > > Thanks > W------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments,...{{dropped}}
You may be interested in this thread from R-devel last October: https://www.stat.math.ethz.ch/pipermail/r-devel/2003-October/027862.html If I recall correctly, Duncan Temple Lang is working on different ways to initialize R but I'm not sure what the status of that is. -roger Webb Sprague wrote:> Hi all, > > Is there any documentation on running R like one would run a shell or > Perl script, with out/input directed appropriately, environment variable > access, and command switch processing? > > I looked some, and even remembered to check the FAQ, but couldn't find > anything. > > Thanks > W > > ______________________________________________ > R-help at stat.math.ethz.ch 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 >
Webb Sprague <wwsprague <at> ucdavis.edu> writes: : Is there any documentation on running R like one would run a shell or : Perl script, with out/input directed appropriately, environment variable : access, and command switch processing? : : I looked some, and even remembered to check the FAQ, but couldn't find : anything. : I think this would be useful beyond cgi scripts too. In fact, in my top 10 New Year's wishes for R it was listed (#10): http://tolstoy.newcastle.edu.au/R/devel/04a/0039.html I used to use awk heavily but as I use R more and more I find that I think in R more than the others, effectively losing my facility with those other languages. In fact, whenever I have something that seems more appropriate for awk than for R, then if I do write it in awk I will often see if I can rewrite it in R to keep the number of tools used to a minimum. At this point, I would like to do everything I used to do in awk in R to simplify things down to one language since R is inevitably used somewhere along the line whenever I use awk. I am not sure what facilities would be useful for this but I think that making awk-like things easy, might involve more than just cleaning up the initialization.
t. <- table(a,b) xtable(format(t.)) From: Ian Wilson <I.Wilson at maths.abdn.ac.uk> : : Any more elegant solutions to this? : : > a <- sample(c("a","d","c"),100,replace=T) : > b <- sample(c("d","e","f",100,replace=T) : > t <- table(a,b) : > xtable(t) : Error in xtable(t) : no applicable method for "xtable" : : The problem is that while t is a table (and : hence also a matrix) : : > is.matrix(t) : [1] TRUE : : data.frame(t) produces : : > data.frame(t) : a b Freq : 1 1 1 12 : 2 2 1 12 : 3 3 1 7 : 4 1 2 8 : 5 2 2 12 : 6 3 2 11 : 7 1 3 13 : 8 2 3 17 : 9 3 3 8 : : After a horrible solution, I have : ct <- apply(t,2,cbind); : rownames(ct) <- rownames(t); : xtable(ct) : : Is this a bug/feature, and if so how do I get round it? : : Ian Wilson :