[R] Prevent read.table from converting "+" and "-" to 0

Duncan Murdoch murdoch at stats.uwo.ca
Tue Nov 4 15:18:02 CET 2008


On 11/4/2008 9:08 AM, Daren Tan wrote:
> I am using read.table("data.txt", sep="\t") to read in a tab-limited text file. However, two columns of data were read wrongly. read.table converts "+" and "-" in the two columns to 0. I have tried setting other parameters but to no avail. 

Set the column classes (using the colClasses argument).  It is guessing 
numeric, but clearly that's not true.

Duncan Murdoch



More information about the R-help mailing list