r - melt.data.table may crash when measure.vars contains variables not in data.table -
the next code crashes in installation:
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
the message following:
*** 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"))
here 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 of operations packages: [1] stats graphics grdevices utils datasets methods base of operations > library(data.table) data.table 1.9.2 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 of operations packages: [1] stats graphics grdevices utils datasets methods base of operations other attached packages: [1] reshape2_1.4 data.table_1.9.2 loaded via namespace (and not attached): [1] plyr_1.8.1 rcpp_0.11.1 stringr_0.6.2
it may same problem reported here: melting data.table seems crash rstudio?
thanks post , bug report. fixed commit 1261 of v1.9.3. news:
melt
returns friendly error when meaure.vars
not in info instead of segfault. closes #699. vsalmendra this post on so , subsequent bug report. please write if issue persists.
r crash data.table reshape2
No comments:
Post a Comment