Re: [R] Subset POSIXlt Field

2010-10-05 Thread Ryan Garner
This should work: > test <-subset(wild,ID=="2830" & Date==as.POSIXlt("2010-08-17")) If not, here's another solution: > dates <- c("2010-05-28","2010-08-17") > dates <- as.POSIXlt(dates) > id <- c("2830","2830") > data <- data.frame(id,dates) > test <- data[data$id == "2830" & data$dates == as.POS

Re: [R] Subset POSIXlt Field

2010-10-05 Thread Phil Spector
Jared - The value "2010-08-17" is a character value, and your dates are stored as POSIXlt values. So you'd need to use Date == as.POSIXlt("2010-08-17") in your subset statement. - Phil Spector Statistic