Yet another way to do it using a specialized package, tsibble
library(dplyr)
library(lubridate)
library(tsibble)
df.xlsx1 <- data.frame(
Year = c(1985, 1985, 1985, 1985, 1985),
Month = c(1, 1, 1, 1, 1),
Day = c(1, 2, 5, 6, 7),
Value = c(10, 12, 11.8, 15, 21)
)
df.xlsx1 %>%
mutate(Date = make_date(year = Year, month = Month, day = Day)) %>%
as_tsibble(index = Date) %>%
fill_gaps() %>%
filter(is.na(Value)) %>%
select(Date)
#> # A tsibble: 2 x 1 [1D]
#> Date
#> <date>
#> 1 1985-01-03
#> 2 1985-01-04