Re: [R] how to choose dates data?

2013-07-04 Thread David Carlson
ata. - David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of arun Sent: Thursday, July 4, 2013 9

Re: [R] how to choose dates data?

2013-07-04 Thread arun
; "2008-04-12" "2008-04-12" #or library(xts) xt1<- xts(seq_along(day),day) index(xt1["2007/2009"]) #[1] "2008-04-12" "2008-04-12" "2008-04-12" #or library(chron) yr1<-month.day.year(unclass(day))$year day[yr1>=2007 & yr1<=2009

Re: [R] how to choose dates data?

2013-07-04 Thread Prof Brian Ripley
On 04/07/2013 11:36, Dante.py wrote: > They are really good methods. Thank you very much. > Could I ask one more question. Is there obvious difference between these > two methods? Yes. It is obvious that the type of x differs. > > > 2013/7/4 Prof Brian Ripley >

Re: [R] how to choose dates data?

2013-07-04 Thread Dante.py
They are really good methods. Thank you very much. Could I ask one more question. Is there obvious difference between these two methods? 2013/7/4 Prof Brian Ripley > On 04/07/2013 08:04, Dante.py wrote: > >> I have a method which is not so smart --use grep to match the pattern. >> for example:

Re: [R] how to choose dates data?

2013-07-04 Thread Prof Brian Ripley
On 04/07/2013 08:04, Dante.py wrote: I have a method which is not so smart --use grep to match the pattern. for example: dates <- c("02/27/92", "02/27/92", "01/14/92", "02/28/92", "02/01/91") day <- as.Date(dates, "%m/%d/%y") day: [1] "1992-02-27" "1992-02-27" "1992-01-14" "1992-02-28" "1991-02-0

Re: [R] how to choose dates data?

2013-07-04 Thread Dante.py
I have a method which is not so smart --use grep to match the pattern. for example: dates <- c("02/27/92", "02/27/92", "01/14/92", "02/28/92", "02/01/91") day <- as.Date(dates, "%m/%d/%y") day: [1] "1992-02-27" "1992-02-27" "1992-01-14" "1992-02-28" "1991-02-01" If I want to search for 1991, I can

[R] how to choose dates data?

2013-07-03 Thread Gallon Li
i have converted my data into date format like below: > day=as.Date(originaldate,"%m/%d/%Y") > day[1:5] [1] "2008-04-12" "2011-07-02" "2011-09-02" "2008-04-12" "2008-04-12" I wish to select only those observations from 2007 to 2009, how can I select from this list? [[alternative HTML ver