[R] column of dates into time series

DispersionMap frenchcr at btinternet.com
Sun Nov 29 13:44:13 CET 2009


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.




More information about the R-help mailing list