[R] reading text file not table

Patrick Burns pburns at pburns.seanet.com
Sat Feb 17 11:18:31 CET 2007


'count.fields' is often useful in such situations to see how
R's view of the file differs from your own.  (It isn't such
a rare occurrence for differences to happen when the file
comes from Excel.)

If I understand properly, you can use

sep='\n'

as part of your alternative plan.  But I don't think you would
need to write a file and read it back in again.


Patrick Burns
patrick at burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")


H. Paul Benton wrote:

>Hello all,
>
>I'm looking for a way to be able to read a text file into R. It's a csv
>file but when I do
>"txt <-read.table("F00.csv", header=T, sep=",")" It doesn't read the
>file properly, and I only get 2 columns. If I open it up in OOc or Excel
>it open right with 7 columns.
>What I would really like to do is read the file as text and then split
>it and read the bottom section where the 7 columns are. Then I would
>re-read the table with read.table.
>
>    Thank you for any help,
>
>    Paul
>
>  
>



More information about the R-help mailing list