作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
以下代码在我的安装中崩溃:
library(data.table)
library(reshape2)
x = data.table(a=c(1,2),b=c(2,3),c=c(3,4))
melt(x,id.vars="a") # OK
melt(x,id.vars="a",measure.vars=c("c","d")) # Crashes
*** caught segfault ***
address 0x21000038, cause 'memory not mapped'
Traceback:
1: melt.data.table(x, id.vars = "a", measure.vars = c("c", "d"))
2: melt(x, id.vars = "a", measure.vars = c("c", "d"))
R version 3.1.0 (2014-04-10)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=ro_RO.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=ro_RO.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=ro_RO.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=ro_RO.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
> library(data.table)
data.table 1.9.2 For help type: help("data.table")
> library(reshape2)
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=ro_RO.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=ro_RO.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=ro_RO.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=ro_RO.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] reshape2_1.4 data.table_1.9.2
loaded via a namespace (and not attached):
[1] plyr_1.8.1 Rcpp_0.11.1 stringr_0.6.2
最佳答案
感谢您的发布和错误报告。现在,此问题已通过v1.9.3的commit 1261修复。从NEWS:
melt
now returns friendly error whenmeaure.vars
are not in data instead of segfault. Closes #699. Thanks to vsalmendra for this post on SO and the subsequent bug report.
关于r - 当measure.vars包含不在data.table中的变量时,melt.data.table可能会崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24326797/
java.lang.Throwable 的哪些子类可能被空语句抛出? 通过短语“空语句”,我指的是“无”、“分号”和“分号”: // .... A(); B(); C(); try { //
我是一名优秀的程序员,十分优秀!