我一直试图回答this问题并使用tidyr收集数据。这崩溃了RStudio,当它从终端来源时它也会崩溃。
我从终端的错误中得到以下内容。
> head(df2)
*** caught segfault ***
address 0x18, cause 'memory not mapped'
Traceback:
1: format.POSIXlt(x[[i]], ..., justify = justify)
2: format(x[[i]], ..., justify = justify)
3: format.data.frame(x, digits = digits, na.encode = FALSE)
4: as.matrix(format.data.frame(x, digits = digits, na.encode = FALSE))
这是我一直在运行的脚本:
DF <- structure(list(Time = structure(1:5, .Label = c( '2015-03-10T11:25:35Z','2015-03-10T11:25:40Z','2015-03-10T11:25:41Z','2015-03-10T11:25:42Z','2015-03-10T11:25:43Z'), class = "factor"), Bid = c(6118.5, 6118.5, 6119.5, 6119, 6119), Offer= c(6119.5, 6119.5, 6119.5, 6120, 6119.5)), .Names = c("Time", "Bid", "Offer"), row.names = c(NA, -5L), class = "data.frame")
DF$Time <- strptime(DF$Time, format = "%Y-%m-%dT%H:%M:%SZ", tz = "UTC")
require(ggplot2)
require(tidyr)
df2 <- gather(DF, type, value, -Time)
head(df2)
是否可以使用POSIX收集数据?
修改以添加sessionInfo()
> sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu 14.04.2 LTS
other attached packages:
[1] tidyr_0.2.0