EndTime 要比 BeginTime 少一天;
我写的代码 太复杂 , 有更简洁的写法吗?
- # 指定起始时间
- startdate <- as.Date("2018-01-01")
- enddate <- as.Date("2018-03-10")
- ndays <- enddate - startdate + 1
- tt <- ts(1:ndays, frequency =1, start =as.Date("2018-01-01"))
- ss <- as.Date("2018-01-01")
- dates <- seq(from=ss, by=1, length.out=ndays)
- ## 指定结束时间 ##
- startdate_1 <- as.Date("2018-01-01")
- enddate_1 <- as.Date("2018-03-10")
- ndays_1 <- enddate - startdate + 1
- tt_1 <- ts(1:ndays, frequency =1, start =as.Date("2018-01-01"))
- ss_1 <- as.Date("2018-01-02")
- dates_1 <- seq(from=ss_1, by=1, length.out=ndays_1)
- #生成日序列
- BeginTime <- str_c(dates, "00:00:00", sep = " ")
- EndTime <- str_c(dates_1, "00:00:00", sep = " ")


雷达卡




京公网安备 11010802022788号







