Re: [R] Linux System Function

2010-04-24 Thread Ryan Garner
Clever solution. I use paste alot and didn't think to use it for this problem. Thanks! -- View this message in context: http://r.789695.n4.nabble.com/Linux-System-Function-tp2063058p2063113.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Linux System Function

2010-04-23 Thread Marc Schwartz
On Apr 23, 2010, at 6:07 PM, Ryan Garner wrote: > > How do I pass a filename as an argument to the system command to count the > number of records in that file? I only know how to do it by hardcoding it. > > HARDCODING EXAMPLE >> test <- matrix(1:20,ncol=5) >> write(x = test,file = "test.txt") >

[R] Linux System Function

2010-04-23 Thread Ryan Garner
How do I pass a filename as an argument to the system command to count the number of records in that file? I only know how to do it by hardcoding it. HARDCODING EXAMPLE > test <- matrix(1:20,ncol=5) > write(x = test,file = "test.txt") > records <- as.numeric(system("cat test.txt | wc -l",intern =