[R] How to get a subset with a date such as Date=11/03/2013 HE=02*?

arun smartpink111 at yahoo.com
Mon Mar 24 23:54:20 CET 2014


Hi,
Not sure I understand it correctly.  

If you want to extract the dates with "02*":
Col1<-c("11/02/2008*", "11/02/2008", "11/02/2008", "11/02/2008")
Col2<-c("02*", "02", "03", "04")

Col12 <- paste(Col1, Col2)

Col3 <- c("11/02/2008 02*", "11/02/2008 02", "11/02/2008 03", "11/02/2008 04") 
 Col3[grepl("02\\*$",Col3)]
#[1] "11/02/2008 02*"
 Col12[grepl("02\\*$",Col12)]
#[1] "11/02/2008* 02*"
A.K.


I'm having a problem working with daylight savings dates in R. 

I'm downloading data in two formats. 

Format One Col 1: a date such as "11/03/2013" col 2: Hour ending = 02* 
Col1<-c("11/02/2008*", "11/02/2008", "11/02/2008", "11/02/2008") 
Col1<-c("02*", "02", "03", "04") 

Another data set is something like this: "11/03/2013 02*" 
Col1<-c("11/02/2008 02*", "11/02/2008 02", "11/02/2008 03", "11/02/2008 04") 

These data frames are very big and over multiple years with multiple values for each hour ending. 

I'm trying to build subsets, filter, merge tables, 
lookup values with dates like these. How do I go about working with the 
"02*"?



More information about the R-help mailing list