[R] problems with reading the data and merge

From: kayj <kjaja27_at_yahoo.com>
Date: Thu, 05 Jun 2008 16:58:43 -0700 (PDT)

I have a problem with reading a file data.txt that has a header Each row has the individual ID and then some data that are letter and numbers such as 00
If I read the file as

  data<-read.table("data.txt",sep='\t', header=T)   write.table(data,file="data1.txt", sep='\t', quote=F, col.names=T, row.names=F)

data1.txt looks different than data.txt. In data1.txt some of the 00 entries are replaced with just a 0!

But If I read the file as
data<-read.table("data.txt",sep='\t', header=F) write.table(data,file="data2.txt", sep='\t', quote=F, col.names=F, row.names=F)

Then data2.txt looks exactly like data.txt (no problem)

My problem is when I need to merge data with another data set for example data3,
How can I telll R to merge them If I specify the header=F, I tried

M<-merge(data, data3, by”V1”) This does not work.

What is the problem? I hope someone can help

View this message in context: http://www.nabble.com/problems-with-reading-the-data-and-merge-tp17682040p17682040.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 06 Jun 2008 - 06:05:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 06 Jun 2008 - 07:30:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive