On Tue, 4 Nov 2008, Duncan Murdoch wrote:

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.

I don't think any recent version of R (e.g. 2.7.1 and later) does that, although some earlier versions did on some platforms.

So an even better solution is to update the R involved (as the posting guide asked...).

--
Brian D. Ripley,                  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to