Take a look at the 'ti' stuff in the tis package on CRAN. If I
understand you correctly, you want something like this:

weekNumber <- function(aDate){
    aTi <- ti(aDate, tif = "wfriday")
    may1ymd <- 10000*year(aTi) + 501
    baseWeek <- ti(may1ymd, tif = "wfriday")
    return(aTi - baseWeek + 1)
}

-- 
Jeff

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to