[R] Extracting future and past workday dates

Sergey Goriatchev sergeyg at gmail.com
Fri Aug 6 13:49:17 CEST 2010


Henrique, that is what I need!
Big thanks!

Regards,
Sergey

On Thu, Aug 5, 2010 at 14:56, Henrique Dallazuanna <wwwhsd at gmail.com> wrote:
> n <- 3
> w <- as.numeric(format(Sys.Date(), '%w'))
> fut <- c(Sys.Date() - 0:(n + ifelse(w - n > 6, (w - n) - 6, 0)),
>          Sys.Date() + 1:(n + 1 + ifelse(w + n > 6, (w + n) - 6, 0)))
> sort(fut[!format(fut, '%w') %in% c(6, 0)])



-- 
Kniven skärpes bara mot stenen.



More information about the R-help mailing list