[R] Passing R connection as argument to a shell command on Windows

Anupam Tyagi AnupTyagi at yahoo.com
Mon Sep 25 19:18:31 CEST 2006


Hello, is there a way to pass a connection to a file in a zipped archive as
argument (instead of a file name of unzipped file) to shell command "cut". In
general, is it possible to pipe output of a R function to a shell command? How?

I want to do something like:

z = unz("zipArchive.zip", "fileASCII.ASC")
# open connection
open(z)
# cut lines of the ASCII file in zipped archive at specific postions and send
results to another file.
shell("cut -c2-3,5-8 z > test2.dat")

Anupam.



More information about the R-help mailing list