我有这样的数据:
UINavigationBar
我想每10分钟重新采样一次。
Date Time Value
02-09-17 14:17:20 92
02-09-17 14:17:20 91
02-09-17 14:17:20 38.62391
02-09-17 14:17:20 120.3348
02-09-17 14:17:20 18.1
02-09-17 14:17:20 11.2
02-09-17 14:26:40 97
02-09-17 14:26:40 102
02-09-17 14:26:40 38.62254
02-09-17 14:26:40 120.3719
02-09-17 14:26:40 18.1
02-09-17 14:26:40 11.2
02-09-17 14:30:09 103
02-09-17 14:30:09 103
02-09-17 14:30:09 38.62012
02-09-17 14:30:09 120.3853
02-09-17 14:30:09 18.1
02-09-17 14:30:09 11.3
02-09-17 14:37:00 102
02-09-17 14:37:00 103
02-09-17 14:37:00 38.61536
02-09-17 14:37:00 120.4119
02-09-17 14:37:00 18.1
02-09-17 14:37:00 11.3
02-09-17 14:41:30 101
02-09-17 14:41:30 101
02-09-17 14:41:30 38.61232
02-09-17 14:41:30 120.4295
02-09-17 14:41:30 18.1
02-09-17 14:41:30 11.3
02-09-17 14:46:59 99
02-09-17 14:46:59 98
02-09-17 14:46:59 38.60936
02-09-17 14:46:59 120451
02-09-17 14:46:59 18.1
02-09-17 14:46:59 11.3
02-09-17 14:51:20 97
02-09-17 14:51:20 96
我收到了:
try.xts中的错误(x,错误="必须是xts-coercible或 timeBased"):必须是xts-coercible或timeBased
答案 0 :(得分:0)
我找到了解决方案。
您必须将数据转换为as_xts并定义日期列:
newdata <- as_xts(thedata, date_col = `Date Time`)
newdata <- newdata[endpoints(newdata, "minutes", 10)]