I have two tables:
no checkin checkout
1 1/3/2018 1/5/2018
And:
no check-in check-out new checkout date
1 1/3/2018 1/5/2018 1/4/2018
1 1/3/2018 1/5/2018 1/5/2018
I would like to view this on a daily level.
dailyEsp <- difftime(as.Date(Esp$CheckOut, format = '%m/%d/%Y'), as.Date(Esp$CheckIn, format = '%m/%d/%Y'), units = "days")
for (i in 1:dailyEsp){
newcheckout = as.Date(Esp$CheckIn, format = '%m/%d/%Y') + i - 1
merge(Esp[nrow(Esp) + dailyEsp,], newcheckout-1)
}
I cannot think of the logic on how to merge existing dataset to the new checkout date.