Re: [R] Problem with combining 2 data frame

2019-02-18 Thread PIKAL Petr
together with merged x2 values. Cheers Petr > -Original Message- > From: R-help On Behalf Of David L Carlson > Sent: Sunday, February 17, 2019 1:49 AM > To: Eric Berger ; javad bayat > > Cc: R mailing list ; r-help-ow...@r-project.org > Subject: Re: [R] Problem with

Re: [R] Problem with combining 2 data frame

2019-02-16 Thread David L Carlson
at Cc: R mailing list ; r-help-ow...@r-project.org Subject: Re: [R] Problem with combining 2 data frame Hi Javad, You have a number of problems with your code, such as: 1. you should set df1 and df2 without factors 2. you define a function f(x,y) but the body of the function never refers to x an

Re: [R] Problem with combining 2 data frame

2019-02-15 Thread Eric Berger
Hi Javad, You have a number of problems with your code, such as: 1. you should set df1 and df2 without factors 2. you define a function f(x,y) but the body of the function never refers to x and y The following code does what I think you are looking for: df1 = data.frame(x1 = letters[1:26],x2 = NA

[R] Problem with combining 2 data frame

2019-02-15 Thread javad bayat
Dear R users; I am trying to combine 2 dataframes with different rows, 26 and 6 rows. The first column of both dataframe has something in common, and I want to compare the first column of the df1 with first column of the df2 to see if they are same or not. Then if they were same, the second column