[R] problem merging two data sets ( one with a header and one without)

2008-08-21 Thread kayj
I have two set of data, Data1 and Data2 . Data1 has a header and Data2 does not. I would like to merge the two data sets after removing some columns from data2 . I am having a problem merging so I had to write and read final data and specify the “header=F” so the merge can be done by”V1”. Is

Re: [R] problem merging two data sets ( one with a header and one without)

2008-08-21 Thread Don MacQueen
merge() has by.x and by.y arguments. If you use them, you can merge data frames that have different column names. You can specify columns by name or by number. This is mentioned in the help for merge. Try merge(Data1, Data2, by.x=1, by.y=2) which will keep all of the columns in Data2, or