Description Usage Arguments Value Examples
Merging datsets by date intervals
1 2 | merge_by_date_interval(data1, data2, key_col = "country_name", startdate1,
enddate1, startdate2, enddate2, group_vars = NULL)
|
data1 |
|
data2 |
|
key_col |
|
startdate1 |
|
enddate1 |
|
startdate2 |
|
enddate2 |
|
group_vars |
A dataset merging data1
and data2
by the key_col
with each row of data1
split according to which part of it falls
within the intervals in data2
1 2 3 4 5 | library(dplyr)
data1 <- archigos %>% select(country_name,obsid,leader,startdate,enddate) %>% filter(country_name == "Cuba")
data2 <- polity_cases %>% select(country_name, polity, polity_startdate, polity_enddate) %>% filter(country_name == "Cuba")
results <- merge_by_date_interval(data1, data2, "country_name", "startdate", "enddate", "polity_startdate", "polity_enddate", "obsid")
results
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.