Displaying 1 result from an estimated 1 matches for "mypaths4".
Did you mean:
mypaths5
2012 Nov 17
1
Strange problem with reading a pipe delimited file
...ing 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("mypaths4.txt", sep="|", quote=NULL, header=F, colClasses="character")
> test
V1 V2 V3 V4 V5 V6 V7 V8 V9
1 A B C D
2 A B C D E F
3 A B C D E
4 A B C D E F G H I
5 A B C D
6 A B C D E F G H I...