我有以下数据框。时隙之间的差距是不同的,有时小,有时大:
history <- structure(list(timestamp = structure(1:13, .Label = c("2006-06-11 04:43:56",
"2006-06-11 04:47:24", "2006-06-11 04:47:54", "2006-06-11 04:49:37",
"2006-06-11 04:52:12", "2006-06-11 04:58:22", "2006-06-11 05:01:11",
"2006-06-11 05:06:56", "2006-06-11 05:14:35", "2006-06-11 05:21:44",
"2006-08-21 19:55:50", "2006-08-21 19:56:31", "2007-11-22 22:09:17"
), class = "factor"), page_length = c(1753, 146, 2401, 461, 113,
1248, 1268, 720, 1290, 436, 531, 502, 746)), .Names = c("timestamp",
"page_length"), row.names = c(NA, -13L), class = "data.frame")
history
# timestamp page_length
#1 2006-06-11 04:43:56 1753
#2 2006-06-11 04:47:24 146
#3 2006-06-11 04:47:54 2401
#4 2006-06-11 04:49:37 461
#5 2006-06-11 04:52:12 113
#6 2006-06-11 04:58:22 1248
#7 2006-06-11 05:01:11 1268
#8 2006-06-11 05:06:56 720
#9 2006-06-11 05:14:35 1290
#10 2006-06-11 05:21:44 436
#11 2006-08-21 19:55:50 531
#12 2006-08-21 19:56:31 502
#13 2007-11-22 22:09:17 746
但我遇到的问题是,当我使用以下方法进行绘图时,我没有明确区分时间。
plot(as.POSIXlt(history$timestamp,format='%Y-%m-%d %H:%M:%S'),
log(history$page_length), xlab= "Months", ylab= "log page Length", type='l', col='red')
正如您在情节中看到的那样,我想在短时间跨度之间获得良好的分离