Gabor Grothendieck wrote:
On 8/17/06, Martin Maechler [EMAIL PROTECTED] wrote:
Gregor == Gregor Gorjanc [EMAIL PROTECTED]
on Fri, 11 Aug 2006 00:27:27 + (UTC) writes:
[snip]
There are two problems:
1. as.POSIXlt is not generic. (This problem may not be too important
given
Gregor == Gregor Gorjanc [EMAIL PROTECTED]
on Fri, 11 Aug 2006 00:27:27 + (UTC) writes:
Gregor Gabor Grothendieck ggrothendieck at gmail.com writes:
Here are three ways:
xx - as.Date(2006-01-05)
# 1. use as.POSIXlt
as.POSIXlt(xx)$mday
Martin Maechler wrote:
Gregor == Gregor Gorjanc [EMAIL PROTECTED]
on Fri, 11 Aug 2006 00:27:27 + (UTC) writes:
Gregor Gabor Grothendieck ggrothendieck at gmail.com writes:
Here are three ways:
xx - as.Date(2006-01-05)
# 1. use as.POSIXlt
On 8/17/06, Martin Maechler [EMAIL PROTECTED] wrote:
Gregor == Gregor Gorjanc [EMAIL PROTECTED]
on Fri, 11 Aug 2006 00:27:27 + (UTC) writes:
Gregor Gabor Grothendieck ggrothendieck at gmail.com writes:
Here are three ways:
xx - as.Date(2006-01-05)
#
Hi list,
I'm trying to turn a date into something productive. (Not what you may be
thinking)
I want three functions so I could take a date object and get the day of week,
month, and year from it.
xx - as.Date(2006-01-05)
month(xx) equal 1
day(xx) equal 5
year(xx) equal 2006
I'm aware
Here are three ways:
xx - as.Date(2006-01-05)
# 1. use as.POSIXlt
as.POSIXlt(xx)$mday
as.POSIXlt(xx)$mon + 1
as.POSIXlt(xx)$year + 1900
# 2. use format
as.numeric(format(xx, %d))
as.numeric(format(xx, %m))
as.numeric(format(xx, %Y))
# 3. use month.day.year in chron package
library(chron)
Gabor Grothendieck ggrothendieck at gmail.com writes:
Here are three ways:
xx - as.Date(2006-01-05)
# 1. use as.POSIXlt
as.POSIXlt(xx)$mday
as.POSIXlt(xx)$mon + 1
as.POSIXlt(xx)$year + 1900
# 2. use format
as.numeric(format(xx, %d))
as.numeric(format(xx, %m))