Displaying 1 result from an estimated 1 matches for "set2march".
2007 Jun 13
5
Confusion with sapply
...give a negative
increment (decrement) here.
return(as.Date(seq.dates(format(xdate,"%m/%d/%Y"),by="months",len=4)[4])
)
Hence this simple function:
> mydate <- as.Date("2006-01-01")
>
> # Function to shift non-March company-reporting dates to March.
> Set2March <- function(xdate){
+ # Combines non-March months into March months:
+ # Dec2006 -> Mar2007
+ # Mar2006 -> Mar2006
+ # Jun2006 -> Mar2006
+ # Sep2006 -> Mar2006
+ # VERY Specific code.
+ Month <- format(xdate,"%m")
+ wDate <- month.day.year(julian(xdate))
+...