[R] strange behavior when reading csv

Thomas Keller
Mon, 01 Jun 2009 16:57:07 -0000

Martin,
"The number of data columns is determined by looking at the first five
lines of input (or the whole file if it has less than five lines), or
from the length of col.names if it is specified and is longer. This
could conceivably be wrong if fill or blank.lines.skip are true, so
specify col.names if necessary."
This may not be work for you, but if you can figure out the longest
row for each file, you could create a col.names object that would
force read.csv() to read all the columns.
e.g.
 > probNames <- paste("V",1:43)
 > probData <- read.csv("/Users/kellert/Documents/Computing/R_work/
problem.txt", sep = ";", header = FALSE, fill = TRUE, col.names =
probNames)

cheers,

Tom
kellert at ohsu.edu
503-494-2442


On Jun 1, 2009, at 3:00 AM, r-help-request at r-project.org wrote:

>  1. Re: strange behavior when reading csv - line wraps (Martin Tomko)