Re: [R] R shell script

2012-04-25 Thread Steve Lianoglou
Hi, On Wed, Apr 25, 2012 at 11:11 AM, aoife doherty wrote: > Thanks for replying. > > My problem is that i have say 50 input files, that i wanted to run a > particular command on, get 50 output files, and then when i close R, have > them in my directory? > > so for example if i say: > >>R > >>lib

Re: [R] R shell script

2012-04-25 Thread mlell08
On 25.04.2012 17:12, Steve Lianoglou wrote: > Check out the vignette for the optparse library: > > http://cran.r-project.org/web/packages/optparse/vignettes/optparse.pdf > > Super helpful library if you plan on making any semi-interesting > command line scripts w/ R. > > -steve > > On Wed, Apr 25,

Re: [R] R shell script

2012-04-25 Thread Steve Lianoglou
Check out the vignette for the optparse library: http://cran.r-project.org/web/packages/optparse/vignettes/optparse.pdf Super helpful library if you plan on making any semi-interesting command line scripts w/ R. -steve On Wed, Apr 25, 2012 at 6:47 AM, aoife doherty wrote: > Hey guys, > Does an

Re: [R] R shell script

2012-04-25 Thread aoife doherty
Thanks for replying. My problem is that i have say 50 input files, that i wanted to run a particular command on, get 50 output files, and then when i close R, have them in my directory? so for example if i say: >R >library(MASS) >list.files(pattern = ".out") >sapply(list.files(pattern = *.ou

Re: [R] R shell script

2012-04-25 Thread R. Michael Weylandt
You can do this in bash but why not just do it in R directly? You probably need list.files(pattern = ".out") to get started. Then just wrap your script in a function and pass it to (s|l)apply something like: sapply(list.files(pattern = *.out"), function(x) wilcox.test ( ... ) ) Michael On Wed

[R] R shell script

2012-04-25 Thread aoife doherty
Hey guys, Does anyone have an example of a REALLY simple shell script in R. Basically i want to run this command: library(MASS) wilcox.test(list1,list2,paired=TRUE,alternative=c("greater"),correct=TRUE,exact=FALSE) in a shell script something like this: #!/bin/bash R library(MASS) for i in *.ou