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. TIA _________________________________________________________________ Get in touch with your inner athlete. Take the quiz.
Duncan Murdoch
2008-Nov-04 14:18 UTC
[R] Prevent read.table from converting "+" and "-" to 0
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
Dieter Menne
2008-Nov-04 18:34 UTC
[R] Prevent read.table from converting "+" and "-" to 0
Daren Tan <daren76 <at> hotmail.com> writes:> I am using read.table("data.txt", sep="\t") to read in a tab-limited textfile. However, two columns of> data were read wrongly. read.table converts "+" and "-" in the two columns to0. I have tried setting other> parameters but to no avail.Looks like http://article.gmane.org/gmane.comp.lang.r.general/112819 which was corrected by Brian Ripley a few hours after being reported. Dieter
Maybe Matching Threads
- Any simple way to subset a vector of strings that do contain a particular substring ?
- Identifying common prefixes from a vector of words, and delete those prefixes
- counting number of "G" in "TCGGGGGACAATCGGTAACCCGTCT"
- Beautify R scripts in microsoft word
- Can R do this ?