Hello again, I am simply trying to import a rectangular table of strings. The table's dimensions are 1990 x 2, yet my read.table() command can only find 362 of the rows (and they're not the first 362). I would've taken the time to figure out how to use scan, readLines, or some other tool that can read in character strings, and then parse and input to a table, but that seems like overkill, and probably it would be good to understand what's wrong with my text file. The file is here. https://regtransfers-sth-se.diino.com/download/jonsleepy/_mydropbox_/finalInput.xls The code is here: temp <- as.matrix(read.table('finalInput.xls', header=FALSE, sep = "\t")) dim(temp) #expect 1990 x 2; but find 362 x 2 Sorry to require a download (this probably won't make people happy), but since my problem is file-specific, the file is needed for troubleshooting. I generated it with some grep, gawk commands using Cygwin in a Windows environment (though subsequently converted it to Windows format - R loads it exactly the same way, regardless of whether it's in linux or windows format) Regards, Jonathan [[alternative HTML version deleted]]
On Dec 19, 2009, at 11:42 PM, Jonathan wrote:> Hello again, > I am simply trying to import a rectangular table of strings. The > table's dimensions are 1990 x 2, yet my read.table() command can > only find > 362 of the rows (and they're not the first 362). I would've taken > the time > to figure out how to use scan, readLines, or some other tool that > can read > in character strings, and then parse and input to a table, but that > seems > like overkill, and probably it would be good to understand what's > wrong with > my text file. > > The file is here. > https://regtransfers-sth-se.diino.com/download/jonsleepy/_mydropbox_/finalInput.xls > > The code is here: > temp <- as.matrix(read.table('finalInput.xls', header=FALSE, sep = > "\t")) > dim(temp) #expect 1990 x 2; but find 362 x 2 > > Sorry to require a download (this probably won't make people happy), > but > since my problem is file-specific, the file is needed for > troubleshooting.There is something wrong with line 362. If you delete it and reload the task completes.> > I generated it with some grep, gawk commands using Cygwin in a Windows > environment (though subsequently converted it to Windows format - R > loads it > exactly the same way, regardless of whether it's in linux or windows > format) > > Regards,David Winsemius, MD Heritage Laboratories West Hartford, CT
Most likely an unbalanced quote. put the following option in the read.table: quote='', comment.char='' On Sat, Dec 19, 2009 at 11:42 PM, Jonathan <jonsleepy@gmail.com> wrote:> Hello again, > I am simply trying to import a rectangular table of strings. The > table's dimensions are 1990 x 2, yet my read.table() command can only find > 362 of the rows (and they're not the first 362). I would've taken the time > to figure out how to use scan, readLines, or some other tool that can read > in character strings, and then parse and input to a table, but that seems > like overkill, and probably it would be good to understand what's wrong > with > my text file. > > The file is here. > > https://regtransfers-sth-se.diino.com/download/jonsleepy/_mydropbox_/finalInput.xls > > The code is here: > temp <- as.matrix(read.table('finalInput.xls', header=FALSE, sep = "\t")) > dim(temp) #expect 1990 x 2; but find 362 x 2 > > Sorry to require a download (this probably won't make people happy), but > since my problem is file-specific, the file is needed for troubleshooting. > > I generated it with some grep, gawk commands using Cygwin in a Windows > environment (though subsequently converted it to Windows format - R loads > it > exactly the same way, regardless of whether it's in linux or windows > format) > > Regards, > Jonathan > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]]