I have the following data with paired observations in long format. I am trying to do a paired t-test along time variable in R on the long format, but by first detecting obs that are not available in both time 1 and 2 (obs B and E in this case), and then perhaps creating a new dataframe with the observations in order. Is there a way to do this without reshaping the data into wide format first? Help and suggestions would be appreciated, R newbie here.
obs time value
A   1    5.5
B   1    7.1
C   1    4.3
D   1    6.4
E   1    6.6
F   1    5.6
G   1    6.6
A   2    6.5
C   2    6.7
D   2    7.8
F   2    5.7
G   2    8.9