I am trying to merge two data frames. One data frame, which we'll call "Final" is much longer than the second data frame, which is called "Indvi". I will take a screen shot of the dataframes for reference:
When I did try the merge function, I get a dataframe where "Final" is shown first but then when "Indvi" is shown, all the rows are filled with NS values.
This is the R code I used for merge, which gave the NA values:
finaldf<- merge(DDMfinal, DDMindvi1, by="subject", all.x = T)
I would like the merge to be aligned by the subject ID. There is a column for that in each dataframe.
As for possible problems/source of issue, nothing is wrong with the "by=" because there is a subject column in each dataframe and I set all.x to TRUE. So I really dont know why its giving me issues.
This is what my merge product looks like:
Any help as to why this is happening and how to fix it would be much appreciated!! Thank you so mcuh!
PS: Im sorry for all the pictures, I refered to the "How to ask a good question" post but they only talked about how to not place CODE in pictures and they didnt say anything on how to place dataframes. So, I settelted in pictures, :), sorry if it is inconvenient.