Skip to content
Back to formatted view

Raw Message

Message-ID: <1259498653456-930699.post@n4.nabble.com>
Date: 2009-11-29T12:44:13Z
From: DispersionMap
Subject: column of dates into time series

i have a column of dates in this format:

data[,"Raised.Date"] <- as.Date(data[,"Raised.Date"], "%d/%m/%Y"); 
data[1:10,"Raised.Date"]
[1] "2006-07-07" "2006-07-07" "2006-04-03" "2006-04-03" "2006-04-03"
"2006-04-03" "2006-04-03" "2006-04-03" "2006-04-03" "2006-04-03"

I can turn them into months like this...

Month<-months(data[,"Raised.Date"])
Month[1:10]
[1] "July"  "July"  "April" "April" "April" "April" "April" "April" "April"
"April"


But i also want to turn them into years (and also weeks later on), so tried
this...

Year<-year(data[,"Raised.Date"])
Error: could not find function "year"


thanks.
-- 
View this message in context: http://n4.nabble.com/column-of-dates-into-time-series-tp930699p930699.html
Sent from the R help mailing list archive at Nabble.com.