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

2013-07-01 Thread Berend Hasselman

On 01-07-2013, at 21:03, Thomas Grzybowski  wrote:

> Hi.
> 
> list.files(pattern = "*")
> 
> gives me output with the R list indices at the left of each line on the 
> screen.  I want only file names.
> 

cat(list.files(pattern = "*"),sep="\n")

Berend

> Thanks!
> Tom Grzybowski
> 
> 
> On 07/01/2013 02:55 PM, Rui Barradas wrote:
>> Hello,
>> 
>> Try instead
>> 
>> 
>> list.files(pattern = "*")
>> 
>> 
>> Hope this helps,
>> 
>> Rui Barradas
>> 
>> Em 01-07-2013 19:23, Thomas Grzybowski escreveu:
>>> 
>>> 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
>>> 
>>> __
>>> R-help@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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

2013-07-01 Thread Charles Determan Jr
Hi Thomas,

If you put the list.files statement inside the write function you won't
have the indices.
Try:

write(list.files(pattern="*"), file="my_files.txt")

Cheers,
Charles



On Mon, Jul 1, 2013 at 2:03 PM, Thomas Grzybowski <
thomasgrzybow...@gmail.com> wrote:

> Hi.
>
> list.files(pattern = "*")
>
> gives me output with the R list indices at the left of each line on the
> screen.  I want only file names.
>
> Thanks!
> Tom Grzybowski
>
>
> On 07/01/2013 02:55 PM, Rui Barradas wrote:
>
>> Hello,
>>
>> Try instead
>>
>>
>> list.files(pattern = "*")
>>
>>
>> Hope this helps,
>>
>> Rui Barradas
>>
>> Em 01-07-2013 19:23, Thomas Grzybowski escreveu:
>>
>>>
>>> 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
>>>
>>> __**
>>> R-help@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/**listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/**posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
> __**
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/**
> posting-guide.html 
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Charles Determan
Integrated Biosciences PhD Candidate
University of Minnesota

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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

2013-07-01 Thread Thomas Grzybowski

Hi.

list.files(pattern = "*")

gives me output with the R list indices at the left of each line on the 
screen.  I want only file names.


Thanks!
Tom Grzybowski


On 07/01/2013 02:55 PM, Rui Barradas wrote:

Hello,

Try instead


list.files(pattern = "*")


Hope this helps,

Rui Barradas

Em 01-07-2013 19:23, Thomas Grzybowski escreveu:


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

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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

2013-07-01 Thread Rui Barradas

Hello,

Try instead


list.files(pattern = "*")


Hope this helps,

Rui Barradas

Em 01-07-2013 19:23, Thomas Grzybowski escreveu:


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

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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

2013-07-01 Thread Thomas Grzybowski


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

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.