[R] Unusual separators

2011-08-16 Thread Matt Curcio
Hi all, I have a list that I got from a web page that I would like to crunch. Unfortunately, the list has some unusual separators in it. I believe the columns are separated by 1 space and 1 tab. I tried to insert this into the read.table( ..., sep=" \t", ...) but got an error that said something

Re: [R] Unusual separators

2011-08-16 Thread Jim Holtman
just read in the file using the tab as the separator. if this is a problem because a tab might appear by itself, then use readLines to read in the file, gsub to replace the blank/tab with a new separator, writeLines to write out to a temporary and then read in from the temporary file. Sent fro

Re: [R] Unusual separators

2011-08-20 Thread peter dalgaard
On Aug 17, 2011, at 05:57 , Jim Holtman wrote: > just read in the file using the tab as the separator. if this is a problem > because a tab might appear by itself, then use readLines to read in the file, > gsub to replace the blank/tab with a new separator, writeLines to write out > to a temp

Re: [R] Unusual separators

2011-08-20 Thread Jim Holtman
In the current version (2.13.1) textConnection is much slower if you have a large file (>1 lines) than using a temporary output file. Try timing a script using the two different approachs to get an appreciation for the difference. Sent from my iPad On Aug 20, 2011, at 3:39, peter dalgaard