I have Days in a dataset and I want to show the next 5 days based on the last date in dataset but skipping weekend using R code.
Below I have generated the next 5 days date and but when unable to skip weekend.
lastValue = tail(dataset$Days,1)
> lastValue+1:5
[1] "2017-07-14" "2017-07-15" "2017-07-16" "2017-07-17" "2017-07-18"
If I use Chron function I can remove weekend but how to show 2 more date which removed because of weekend as I need to show 5 days date.
dataset [!chron::is.weekend(as.Date(dataset $Days, "%m/%d/%Y")), ]
[1] "2017-07-14" "2017-07-17" "2017-07-18"
Thanks