Я пытаюсь объединить два больших набора данных в R с помощью 'fuzzyjoin: interval_inner_join'. моя цель состоит в том, чтобы соединить их с таблицей в ближайшее время начала и окончания.
# first dataset
viewing <- data.frame(stringsAsFactors=FALSE,
id = c("100-16", "100-16", "100-16", "100-16", "100-16",
"100-16", "100-16", "100-16", "100-16", "100-16"),
start_utc_day = c("2019-05-01", "2019-05-01", "2019-05-01", "2019-05-01",
"2019-05-01", "2019-05-01", "2019-05-01", "2019-05-01",
"2019-05-01", "2019-05-01"),
start = c("7:18:45", "7:27:30", "7:59:30", "8:37:30", "8:41:15",
"8:47:15", "8:52:45", "8:55:30", "8:57:45", "9:05:00"),
end = c("7:26:15", "7:59:15", "8:33:45", "8:40:30", "8:43:15",
"8:50:15", "8:55:15", "8:57:00", "9:00:00", "9:07:00")
)
# second dataset
location <- data.frame(stringsAsFactors=FALSE,
id = c("100-16", "100-16", "100-16", "100-16", "100-16",
"100-16", "100-16", "100-16", "100-16", "100-16"),
code = c("IN", "IN", "IN", "IN", "IN", "IN", "IN", "IN", "IN",
"IN"),
utc_day = c("2019-05-01", "2019-05-01", "2019-05-01", "2019-05-01",
"2019-05-01", "2019-05-01", "2019-05-01", "2019-05-01",
"2019-05-01", "2019-05-01"),
start = c("7:13:30", "7:17:00", "7:22:00", "7:41:00", "8:14:15",
"8:33:45", "8:43:00", "9:08:45", "9:21:15", "9:32:00"),
end = c("7:15:30", "7:20:30", "7:31:00", "7:43:00", "8:15:45",
"8:35:15", "8:45:30", "9:12:15", "9:23:00", "9:35:15")
)
Ссылаясь на Эта ссылка Я пытался использовать interval_semi_join:
library(fuzzyjoin)
interval_semi_join(viewing,location, minoverlap = 3)
но получил эту ошибку
Joining by: c("id", "start", "end")
Ошибка в index_match_fun (d1, d2):
interval_join должен объединяться ровно в двух столбцах (начало и конец)