Displaying 1 result from an estimated 1 matches for "mydaysx".
2011 May 14
2
changing the day of the week in dates format
...x <- as.POSIXct("2011-01-01 00:00:00")
finx <- as.POSIXct("2011-12-31 00:00:00")
daysx<- seq(startx, finx, by="24 hours")
I
want to change the dates of all the days falling on a Saturday to the
next working day (i.e. Monday). So I convert dates to POSIXlt
mydaysx <- as.POSIXlt(daysx)
Then I change select all the Saturday's and move them on to Monday
select <- mydaysx$wday==6
mydaysx$mday[select] <- mydaysx$mday[select] + 2
However,
although all the new dates (i.e. mydaysx) are actual days of the year -
the $wday have not been updated and t...