I have a problem with comparing dates. i tried it like "datesub subset(data, 2012-11-19 < data$date)", but this doesn't work and i don't know why. Hope you can help me. here are my files: http://uploaded.net/file/n9sxdm0v <http://uploaded.net/file/n9sxdm0v> -- View this message in context: http://r.789695.n4.nabble.com/Date-Comparing-Problem-tp4676739.html Sent from the R help mailing list archive at Nabble.com.
Hi, Try: set.seed(634) dat<- data.frame(date=seq(as.Date("2012-11-15"),length.out=10,by="1 day"), value=rnorm(10)) subset(dat,"2012-11-19" < date)? #???????? date????? value #6? 2012-11-20 -0.3290021 #7? 2012-11-21? 0.3106802 #8? 2012-11-22 -1.0782814 #9? 2012-11-23 -0.1333426 #10 2012-11-24? 0.8441754 A.K. I have a problem with comparing dates. i tried it like "datesub = subset(data, 2012-11-19 < data$date)", but this doesn't work and i don't know why. Hope you can help me. here are my files: http://uploaded.net/file/n9sxdm0v
On 23.09.2013 13:48, Rhymes wrote:> I have a problem with comparing dates. i tried it like "datesub > subset(data, 2012-11-19 < data$date)", but this doesn't work and i don't > know why.Errr, in R: 2012-11-19 == 1982 You probably want to convert it to a Date object or Posix.. object, but since we do not know ehat data$date is..... Best, Uwe Ligges> > Hope you can help me. > > here are my files: > http://uploaded.net/file/n9sxdm0v <http://uploaded.net/file/n9sxdm0v> > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Date-Comparing-Problem-tp4676739.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >