match.pps | R Documentation |
Match session IDs from two datasets by taking into account the date of the sessions. This is useful when linking together data from several experiments done by the same participants; often participants accidentally run the same experiment twice, so this should help to distinguish which experiment datasets temporally fit together.
match.pps(x.ids, x.dates, y.ids, y.dates)
x.ids , y.ids |
IDs to match. |
x.dates , y.dates |
Dates to use in the matching of IDs. |
A data.frame
with two columns, one specifying the indices of x and
one specifying the matched indices of y.
Sercan Kahveci
# In the following example, participant 1 has a single direct match,
# one of participant 2's two sessions in x can be matched to a session in y,
# both of participant 3's sessions in x have a match in y,
# and participant 4 has no match between x and y because the observation in y
# occurs before that in x
x <- data.frame(id=c(1,2,2,3,3,4),
date=as.POSIXct(c(1,1,3,1,3,1)))
y <- data.frame(id=c(1,2,3,3,4),
date=as.POSIXct(c(2,2,4,2,0)))
match.pps(x.ids=x$id,x.dates=x$date,y.ids=y$id,y.dates=y$date)
#> x.rowid y.rowid
#> 1 1 1
#> 2 2 2
#> 3 5 3
#> 4 4 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.