[R] writing to the screen and extra "0"

Thomas Grzybowski thomasgrzybowski at gmail.com
Mon Jul 1 20:23:13 CEST 2013


I am using the "write" function like so (R 3.0.1 on linux):

"wrt" <-
function()
{
     write(system("ls *"),file="")
}

When the files are listed to the screen with wrt(), there is a "0" 
character prepended to the output on the screen.  Worse, when I remove 
the 'file=""' argument to "write", a file named "data" is created in my 
default directory, with a zero in it.

All I am trying to do is output the "ls" of files in my directory, 
without any extra characters or type-attribute information.  Thanks for 
your help!

Thomas Grzybowski



More information about the R-help mailing list