Re: [R] Print list to text file with list elements names

2014-10-02 Thread Ingrid Charvet
OK I get it, all options work well now. Thank you! -Original Message- From: William Dunlap [mailto:wdun...@tibco.com] Sent: 01 October 2014 19:05 To: Ingrid Charvet Cc: r-help@r-project.org Subject: Re: [R] Print list to text file with list elements names You want to put lapply

Re: [R] Print list to text file with list elements names

2014-10-01 Thread William Dunlap
m: William Dunlap [mailto:wdun...@tibco.com] > Sent: 01 October 2014 15:54 > To: Ingrid Charvet > Cc: r-help@r-project.org > Subject: Re: [R] Print list to text file with list elements names > > Omit the sink() statements to see what is happening - > lapply(myList,print) prints &

Re: [R] Print list to text file with list elements names

2014-10-01 Thread Ingrid Charvet
get 10 different text files (one per list element) when what I would like is to have them all in one file... Ingrid -Original Message- From: William Dunlap [mailto:wdun...@tibco.com] Sent: 01 October 2014 15:54 To: Ingrid Charvet Cc: r-help@r-project.org Subject: Re: [R] Print list

Re: [R] Print list to text file with list elements names

2014-10-01 Thread William Dunlap
Omit the sink() statements to see what is happening - lapply(myList,print) prints each item in the list and then the output of lapply is printed via the autoprinting mechanism. If you put this into a function or saved the return value of lapply into a variable or wrapped the call to lapply in a cal

Re: [R] Print list to text file with list elements names

2014-10-01 Thread jim holtman
The result of the 'lapply' is also printed, so try this: sink(sprintf("%s",filename)) invisible(lapply(myList,print)) sink() Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Oct 1, 2014 at 6:59 AM, In