Re: [R] how to merge two files while preserving the number of rows of one file in merged one?

2020-04-21 Thread Jeff Newmiller
Read about the all.x and all.y arguments to ?merge. On April 21, 2020 7:53:33 AM PDT, Ana Marija wrote: >Hello, > >> head(a) > ID_1 pheno >1 0 B >2 fam1000_G1000 0 >3 fam1001_G1001 0 >4 fam1003_G1003 1 >5 fam1005_G1005 0 >6 fam1009_G1009 0 >>

Re: [R] how to merge two files while preserving the number of rows of one file in merged one?

2020-04-21 Thread Ana Marija
this solved it: m=merge(a,b,by="ID_1",all.y = T) On Tue, Apr 21, 2020 at 9:53 AM Ana Marija wrote: > > Hello, > > > head(a) >ID_1 pheno > 1 0 B > 2 fam1000_G1000 0 > 3 fam1001_G1001 0 > 4 fam1003_G1003 1 > 5 fam1005_G1005 0 > 6 fam1009_G1009 0 >

[R] how to merge two files while preserving the number of rows of one file in merged one?

2020-04-21 Thread Ana Marija
Hello, > head(a) ID_1 pheno 1 0 B 2 fam1000_G1000 0 3 fam1001_G1001 0 4 fam1003_G1003 1 5 fam1005_G1005 0 6 fam1009_G1009 0 > head(b) ID_1 ID_2 missing 1 0 0 0 2 fam1000_G1000 fam1000_G1000 0 3