Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seems as though join fails to join all rows. #277

Open
liznecka opened this issue Jun 2, 2016 · 0 comments
Open

Seems as though join fails to join all rows. #277

liznecka opened this issue Jun 2, 2016 · 0 comments

Comments

@liznecka
Copy link

liznecka commented Jun 2, 2016

I'm trying to join two datasets in R. I'm using the join command, as such:

fixdatajoined<- join(fixdata, StimLoc, by = c("Subject", "StimIDIndex"))
nrow(fixdata)
[1] 43237
nrow(StimLoc)
4730
fixdata[0,]
[1] Subject        StimID         Blink          FixDur         FixEnd         FixNum         FixPup         FixStart      
[9] FixX           FixY           FixXRes        FixYRes        TrialNum       TotFixCount    TrialStartTime StimIDIndex        
StimLoc[0,]
[1] Subject     StimLoc     StimIDIndex

However, when I do this, this joins only the first 35331 rows of fixdata. I've tried sorting the data numerically and alphanumerically, but it consistently fails at row 35331. Weirdly, if I create a subset of the fixdata called fixdata2, which starts at row 35332, and try to apply join to that data using:

fixdata2joined<- join(fixdata2, StimLoc, by = c("Subject", "StimIDIndex"))

it still fails. Here's a check to make sure that the identifiers are the same:

count(fixdata$Subject[35331]==StimLoc$Subject)
      x freq
1 FALSE 4644
2  TRUE   86
count(fixdata$StimIDIndex[35331]==StimLoc$StimIDIndex)
      x freq
1 FALSE 4675
2  TRUE   55

So it's not as though there is no matching data. Yet, it still gives me NAs in my fixdata data frame in the column StimLoc, but reports no error. Seems like there may be something wrong here? Any ideas?

Thanks for your package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant