cc
04/28/2009 09:39 r-help@r-project.org
AM ASTSubject
Re: [R] help working with date
Here are a few ways:
> xx <- c("1985-09-02", "1985-09-16", "1985-07-31", "1985-07-31", "1985-09-02",
"1985-08-26", "1985-07-31", "1985-08-26", "1985-09-02", "1985-09-16")
> # 1
> library(zoo)
> as.numeric(floor(as.yearmon(xx)))
[1] 1985 1985 1985 1985 1985 1985 1985 1985 1985 1985
> #2
> as.num
steve_fried...@nps.gov wrote:
My data contains a variable "observation_date" and it contains values as:
1985-09-02
1985-09-15
1985-07-31
1985-09-02
I need to process data annually rather than daily, therefore I'm trying to
1) either extract the first 4 digits from this field and use them as
My data contains a variable "observation_date" and it contains values as:
1985-09-02
1985-09-15
1985-07-31
1985-09-02
I need to process data annually rather than daily, therefore I'm trying to
1) either extract the first 4 digits from this field and use them as a new
variable "year" or 2) kee
4 matches
Mail list logo