Alessandro wrote: > Hi all, > > > > I have two txt file with X,Y,Z column and I need to merge together > > > > I tried > > file_all <- merge("file1.txt","file2.txt") > > but I don't sure about the result. Is It this code correct? > > Thanks Ale > >
That would merge 2 data frames together. If you want to merge files in R you need to import the files 1st then merge them. Something like: one <- read.csv("file1.txt",sep=",",header=TRUE) two <- read.csv("file2.txt",sep=",",header=TRUE) both <- merge(one,two) write.table(both, file="both.txt")) See http://stat.ethz.ch/R-manual/R-patched/library/utils/html/read.table.html and http://stat.ethz.ch/R-manual/R-patched/library/utils/html/write.table.html Alternately there are lots of other ways to do this outside of R especially if you're on Mac or Linux, like cat. Alex _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo