search for: prevmonday

Displaying 2 results from an estimated 2 matches for "prevmonday".

2011 Sep 02
2
previous monday date
...to return the date (in form '%Y-%m-%d') of the Monday previous to the current date. For example: since it is 2011-09-02 today, I would expect 2011-08-29 to be the return value. I found the following in: http://www.mail-archive.com/r-help@r-project.org/msg144184.html Start quote from link: prevmonday <- function(x) 7 * floor(as.numeric(x-1+4) / 7) + as.Date(1-4) For example, > prevmonday(Sys.Date()) [1] "2011-08-15" > prevmonday(prevmonday(Sys.Date())) [1] "2011-08-15" End quote from link. But when I do it I get: > prevmonday <- function(x) 7 * floor(as.nu...
2011 Aug 17
3
Convert week value to date
Hello all, I'm hoping to convert a decimal value for week of the year back to a date object. Eg: strptime(paste(2010,1:52,sep=" "),format="%Y %W") I expected (hoped?) this would give me the date for Monday of each week. Instead, it's giving me 52 values of today's date. Where am I erring? Thanks Michael _______________________________________________________