1

我一直在尝试回答这个问题,并在此过程中使用 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
4

0 回答 0