Skip to content
Prev 178677 / 398506 Next

Odp: help working with date values

Hi

r-help-bounces at r-project.org napsal dne 28.04.2009 15:04:01:
as:
to
new
analysis
the
new.date <- as.Date(observation_date, format="%Y-%m-%d")

and then you can use format for coercing to years

format(new.date, "%Y")

or 

cut(new.date, "year")

Regards
Petr
on
http://www.R-project.org/posting-guide.html