Вы ищете что-то подобное?
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
df1 <- data.frame(Id = c(1, 2, 3, 4, 5),
Date = c(2, 3, 4, 4, 6),
Weight = c(10, 20, 30, 30, 40))
df2 <- data.frame(Id = c(1, 2, 3, 8),
Date = c(2, 3, 4, 5),
Weight = c(10, 20, 30, 10),
late = c(3, 4, 5, 6))
full_join(x = filter(.data = df1, Id %in% setdiff(x = df1$Id, y = df2$Id)),
y = filter(.data = df2, Id %in% setdiff(x = df2$Id, y = df1$Id)))
#> Joining, by = c("Id", "Date", "Weight")
#> Id Date Weight late
#> 1 4 4 30 NA
#> 2 5 6 40 NA
#> 3 8 5 10 6
Создано в 2019-05-03 пакетом представ. (v0.2.1)