analyst41 at hotmail.com
2009-Nov-06 00:34 UTC
[R] R splits character fields in a csv file
I download a csv extract from a database and use read.csv to read it from R and when there are large character fields with embedded blanks, slashes etc. - R often sees one line as two lines (or more). I verfied with readLines that an embedded blank in a character field causes a spurious new line to be seen. I am sure this problem has beem seen before - and would appreciate any help in reading such files.
Could you post a reproducible example? I don't seem to have any problems with this. -Peter Ehlers analyst41 at hotmail.com wrote:> I download a csv extract from a database and use read.csv to read it > from R and when there are large character fields with embedded blanks, > slashes etc. - R often sees one line as two lines (or more). > > I verfied with readLines that an embedded blank in a character field > causes a spurious new line to be seen. > > I am sure this problem has beem seen before - and would appreciate any > help in reading such files. > > ______________________________________________ > R-help at 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. > >