Re: [R] Strange problem with reading a pipe delimited file

2012-11-17 Thread Duncan Murdoch
On 12-11-17 4:34 PM, Brian Feeny wrote: On Nov 17, 2012, at 4:27 PM, Duncan Murdoch wrote: I would suggest reading the help file: read.delim only looks at the first 5 lines to determine the number of columns if you don't specify the colClasses. Duncan Murdoch Duncan, I have tried to pas

Re: [R] Strange problem with reading a pipe delimited file

2012-11-17 Thread Brian Feeny
Duncan, I believe I follow you now, I have done like so with expected results: ncol <- max(count.fields("paths.txt", sep = "|")) test <- read.delim("paths.txt", sep="|", quote=NULL, header=F, colClasses="character", fill=TRUE, col.names = paste("V", seq_len(ncol), sep = "")) Thank you for you

Re: [R] Strange problem with reading a pipe delimited file

2012-11-17 Thread Brian Feeny
On Nov 17, 2012, at 4:27 PM, Duncan Murdoch wrote: >> > > I would suggest reading the help file: read.delim only looks at the first 5 > lines to determine the number of columns if you don't specify the colClasses. > > Duncan Murdoch > Duncan, I have tried to pass colClasses but R complains

Re: [R] Strange problem with reading a pipe delimited file

2012-11-17 Thread Duncan Murdoch
On 12-11-17 4:18 PM, Brian Feeny wrote: I am trying to read in a pipe delimited file that has rows with varying number of columns, here is my sample data: A|B|C|D A|B|C|D|E|F A|B|C|D|E A|B|C|D|E|F|G|H|I A|B|C|D A|B|C|D|E|F|G|H|I|J You can see line 6 has 10 columns. Yet, I can't explain why R

[R] Strange problem with reading a pipe delimited file

2012-11-17 Thread Brian Feeny
I am trying to read in a pipe delimited file that has rows with varying number of columns, here is my sample data: A|B|C|D A|B|C|D|E|F A|B|C|D|E A|B|C|D|E|F|G|H|I A|B|C|D A|B|C|D|E|F|G|H|I|J You can see line 6 has 10 columns. Yet, I can't explain why R does like so: > test <- read.delim("mypat