我想在两个日期之间过滤数据,日期1 = 2014-09-01,日期2 2015-04-30 我正在尝试此代码,但它仍然在2014-09-01之前提供数据。 请帮我 谢谢
W <- function() {
z <- read.csv("RainWind.csv")
# Filter by year
z <- z[z$Year==2014|z$Year==2015,]
z$Date <- as.Date(paste(z$Year, z$Month, z$Day), format = "%Y %m %d")
# Filter between 20140901-20150430
z[z$Date >= as.Date("2014-09-01") & z$Date <= as.Date("2015-04-30"),]
z
}
w <- W()