[R] Getting error while running unix commands within R using system() function

siddu479 onlyfordigitalstuff at gmail.com
Sat Oct 27 13:41:40 CEST 2012


Hello All,

   I use Cygwin ( unix on windows) heavily for all my text data processing.
Also use Cygwin inbuilt *R* to do numerical processing.
*My aim is to integrate R and unix commands to avoid heavy memory usage that
R takes normally.*

I can run many unix commands using system("some unix command or sh script.sh
or even R file itself ") inside R.

But, When I tried to run the command *awk '{print "Hello"$1}' infile.txt* to
prefix "Hello" to my first column of file infile.txt, like below in *R *
*system(" awk '{print "Hello"$1}' infile.txt") *, I am getting the below
error, 
*Error: unexpected symbol in "system("awk '{print "Hello"*
I tried even like *system('awk '{print "Hello"$1}' infile.txt')*, but still
the same error.

This particular error is hampering my entire work, other wise I found this
is excellent way processing the text files at the same time reading back and
forth file outputs from R to unix and vice versa.

Can some one give me provide some solution to this problem ??








-----
Sidda
Business Analyst Lead
Applied Materials Inc.

--
View this message in context: http://r.789695.n4.nabble.com/Getting-error-while-running-unix-commands-within-R-using-system-function-tp4647656.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list