as.week(x, format = "%Y-%m-%d", first.day = "Sunday", before = 7, after = 7)
as.Date
, strptime
, DateTimeClasses
mydates <- c("1/1/04", "1/2/04", "1/7/04", "1/14/04", "8/18/04");
as.week(mydates, format = "%m/%d/%y")
Run the code above in your browser using DataLab