【发布时间】:2014-10-29 15:29:35
【问题描述】:
每次我尝试运行 ggplot2 包 (1.0.0) 中的任何绘图功能时都会收到 caught segfault 错误。我已经用qplot、geom_dotplot、geom_histogram 等进行了尝试。包中的数据(例如diamonds 或economics)工作得很好。
我在 Mac OS 10.9.4(最新版本)和 R 3.1.1(也是最新版本)上运行。使用标准 R GUI、RStudio 以及从命令行使用 R 时,我遇到了同样的错误。该命令会调出默认图形设备(用于 R GUI 和命令行的 Quartz),但也会出现终端错误。
library(ggplot2)
qplot(1:10)
给我错误:
*** caught segfault ***
address 0x18, cause 'memory not mapped'
Traceback:
1: .Call("plyr_split_indices", PACKAGE = "plyr", group, n)
2: split_indices(scale_id, n)
3: scale_apply(layer_data, x_vars, scale_train, SCALE_X, panel$x_scales)
4: train_position(panel, data, scale_x(), scale_y())
5: ggplot_build(x)
6: print.ggplot(list(data = list(), layers = list(<environment>), scales = <S4 object of class "Scales">, mapping = list(x = 1:3), theme = list(), coordinates = list(limits = list(x = NULL, y = NULL)), facet = list(shrink = TRUE), plot_env = <environment>, labels = list(x = "1:3", y = "count")))
7: print(list(data = list(), layers = list(<environment>), scales = <S4 object of class "Scales">, mapping = list(x = 1:3), theme = list(), coordinates = list( limits = list(x = NULL, y = NULL)), facet = list(shrink = TRUE), plot_env = <environment>, labels = list(x = "1:3", y = "count")))
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
这是我的会话信息:
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] graphics grDevices utils datasets stats methods base
other attached packages:
[1] ggplot2_1.0.0 marelac_2.1.3 seacarb_3.0 shape_1.4.1 beepr_1.1 birk_1.1
loaded via a namespace (and not attached):
[1] audio_0.1-5 colorspace_1.2-4 digest_0.6.4 grid_3.1.1 gtable_0.1.2
[6] MASS_7.3-34 munsell_0.4.2 plyr_1.8.1 proto_0.3-10 Rcpp_0.11.2
[11] reshape2_1.4 scales_0.2.4 stringr_0.6.2 tools_3.1.1
我从其他人那里得知这是某种内存问题,但即使我有超过 2 GB 的可用 RAM,也会出现此错误。我知道这是一个广泛使用的包,所以当然这不会发生在每个人身上,但为什么会发生在我身上呢?有谁知道我可以做些什么来解决这个问题?
【问题讨论】:
-
因此,如果您启动一个全新的 R 会话并仅运行这两个命令 (
library(ggplot2); qplot(1:10)),您会收到该错误吗?您能否在运行library(ggplot2)后将sessionInfo()的输出也添加到您的问题中。 -
@MrFlick,是的,这是正确的。此错误发生在全新的 R 会话期间。
sessionInfo输出已添加。 -
“marelac_2.1.3、seacarb_3.0、shape_1.4.1、beepr_1.1 birk_1.1”包的加载位置/时间?您是否在某处设置了
.Rprofile?当您启动 R 时,它是否会恢复已保存的工作区(工作目录中是否有.Rdata文件)? -
@MrFlick,所有这些包都是从
.Rprofile加载的,是的。但是,即使我删除了.Rprofile,也会出现同样的问题。 R 没有恢复已保存的工作区。 -
所以这是一个开始。是否有可能您安装了为 SL 版本开发的 ggplot2 二进制文件?
标签: r