And here is a fourth:
as.numeric(format(dd, %Y)) + (quarters(dd) Q1)
On 10/8/06, Gabor Grothendieck [EMAIL PROTECTED] wrote:
Here are three alternative ways to get the fiscal year as a numeric
value assuming:
dd - as.Date(x$Date,%d/%m/%Y)
# add one to year if month is past March
Hello,
This is likely fairly silly question, and I apologize to whomever takes the
time to respond.
I am a relatively new user of R, on Windows XP, version 2.3.1.
Say I have a data table that looks like the following:
x
Date Location Amount Blue Green
1 01/01/2001 Central1817
Here are three alternative ways to get the fiscal year as a numeric
value assuming:
dd - as.Date(x$Date,%d/%m/%Y)
# add one to year if month is past March
as.numeric(format(dd, %Y)) + (format(dd, %m) 03)
# same but using POSIXlt
# (Even though there are no time zones involved I have seen
#