search for: geteom

Displaying 1 result from an estimated 1 matches for "geteom".

2007 May 10
3
Getting the last day of the month.
...03-31" "2003-03-31" "2004-03-31" [13] "2005-03-31" NA NA "2002-03-31" "2003-03-31" "2004-03-31" [19] "2005-03-31" "2006-03-31" So I add a year, and set the month to 1 in a quick function. > GetEOM <- function(yyyymm=200406){ year <- as.integer(substr(yyyymm,1,4)) month <- as.integer(substr(yyyymm,5,6)) if (month==12){ date <- as.Date(ISOdate(year+1,1,1))-1 }else{ date <- as.Date(ISOdate(year,month+1,1))-1 } print(date) } x$Date <- as.vector(sapply(x$YearEnd,GetEO...