problem with merge(join)

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

problem with merge(join)

Hi helpful people.

I have two datasets (tables) I have created in R from a .csv file.
One is emanodrugspr and the other is emadrug
Both tables have the variables:
Both tables roughly look like this but with different variables after SIGNAL

PARTICIPANTID     SIGNAL     value1   value 2
1111                      1             33           3
1111                      2             34           2
1111                      3             36           8
2222                      1             38           2
2222                      2             36           0
2222                      3             NA           0

There are no other common variables across the datasets other than
When I merge them almost all the data is fine, except for one PARTICIPANT ID
there are suddenly quadruple SIGNAL values and the corresponding data
doesn't even line up.  All the other data is fine except for this one ID.

Currently I am using this:
emaspread <- left_join(emanodrugspr, emadrug, by=NULL, copy=FALSE)

However, I have used merge also and tried various types of joining and every
time I end up with 60 extra observations that are garbage.

The data all came from the same place (was downloaded from an online

(Also, I know those variables have terrible names.)

Any ideas?


Sent from:
datatable-help mailing list
[hidden email]