[R] quick question : interpolating file name in pipe command

Abhishek Pratap abhishek.vit at gmail.com
Thu May 5 23:45:21 CEST 2011


You can ignore my question I was able to figure out the way. I guess
when I touch R after couple of weeks I am rusty.



-Abhi

On Thu, May 5, 2011 at 2:15 PM, Abhishek Pratap <abhishek.vit at gmail.com> wrote:
> Hi Guys
>
> I am trying to read a bunch of files in the loop but pipe function
> which I use to cut few columns is somehow unable to interpolate the
> file variable.
>
>
> eg:
>
>> file="check.txt"
>> data  <- read.table(pipe("cut -f 2,3 file"), sep="\t", col.names=c('pos','cov') )
> cut: file: No such file or directory
>
> how can I pass variable file to pipe so that it can be interpolated.
>
> Thanks!
> -Abhi
>



More information about the R-help mailing list