I have a dataframe like the one given by:
x <- c(1:6)
y <- c("06/01/13 16:00:00",
"06/01/13 16:00:00",
"06/03/13 20:00:00",
"06/03/13 20:00:00",
"06/07/13 20:00:00",
"06/08/13 20:00:00")
dfrm <- data.frame(x,y)
dfrm
x y
1 06/01/13 16:00:00
2 06/01/13 16:00:00
3 06/03/13 20:00:00
4 06/03/13 20:00:00
5 06/07/13 20:00:00
6 06/08/13 20:00:00
I want to make y a chron object:
dfrm$y <- as.chron(dfrm$y, "%m/%d/%y %H:%M")
Then I have a vector of dates:
intensives <- c("06/01/13", "06/07/13")
Then I want to subset the data frame "dfrm" by the dates in the "intensives" vector. What I would do it would something like:
subset(dfrm, y==dates(intensives))
or
subset(dfrm, y %in% dates(intensives))
but both give me a null result.