I am trying to subset a range of dates from a dataframe in R.
The command I'm using is
maumee952000 = maumeedata[maumeedata$Datetime..date.and.time.of.sample.collection. >= "1995-01-01" &
maumeedata$Datetime..date.and.time.of.sample.collection. <= "2000-12-31",]
Using this command, however, results in a dataframe that consists only of NA values under every column. I've made sure that my dates are classed properly.
Here is a sample of my date data
> dput(maumeedata$Datetime..date.and.time.of.sample.collection.[1000:1050])
structure(c(18139, 18140, 18141, 18142, 18143, 18144, 18145,
18145, 18146, 18147, 18148, 18149, 18150, 18151, 18152, 18152,
18153, 18153, 18154, 18154, 18155, 18155, 18156, 18156, 18157,
18157, 18158, 18158, 18159, 18159, 18159, 18160, 18160, 18161,
18161, 18162, 18162, 18163, 18164, 18164, 18165, 18165, 18166,
18166, 18166, 18167, 18167, 18168, 18168, 18169, 18169), class = "Date")
I would appreciate anyone who could tell me what I'm doing wrong.