0

Hello all my df1 looks like this

PID        Sex
TNGP0001    M
TNGP1234    M
TNGP4567    F
123         F
567         M

And my df2 looks like this

PID        V1
TNGP0001       54
TNGP1234       52
123            57
567            58

I want to merge df1 with df2 and want output like

Expected Results:

PID        Sex  V1
TNGP0001    M   54
TNGP1234    M   52
123         F   57
567         M   58

Thanks in adavance.

Rebel_47
  • 69
  • 4

1 Answers1

2

You could simply do

df <- data.frame(PID=df1$PID, Sex=df1$Sex, V1=df2$V1)

A.Panta
  • 86
  • 3