我在数据框中有大量 POSIXlt 时间,我试图查看我每天有多少次这些纪念活动(在这种情况下是骑自行车)。最好的方法是什么?
日期如下所示:
> rides$start.fmtd[1:25]
[1] "2014-01-01 00:06:00" "2014-01-01 00:11:00" "2014-01-01 00:12:00"
[4] "2014-01-01 00:14:00" "2014-01-01 00:15:00" "2014-01-01 00:16:00"
[7] "2014-01-01 00:16:00" "2014-01-01 00:19:00" "2014-01-01 00:20:00"
[10] "2014-01-01 00:20:00"
dput(head())
给了我这个:
> dput(head(rides$start.fmtd))
structure(list(sec = c(0, 0, 0, 0, 0, 0), min = c(6L, 11L, 12L,
14L, 15L, 16L), hour = c(0L, 0L, 0L, 0L, 0L, 0L), mday = c(1L,
1L, 1L, 1L, 1L, 1L), mon = c(0L, 0L, 0L, 0L, 0L, 0L), year = c(114L,
114L, 114L, 114L, 114L, 114L), wday = c(3L, 3L, 3L, 3L, 3L, 3L
), yday = c(0L, 0L, 0L, 0L, 0L, 0L), isdst = c(0L, 0L, 0L, 0L,
0L, 0L)), .Names = c("sec", "min", "hour", "mday", "mon", "year",
"wday", "yday", "isdst"), class = c("POSIXlt", "POSIXt"))
这个特定的框架有大约 300,000 个观测值(它是 capitol bikeshare 数据集,包含系统中的每一次骑行,每季度打包一次)。