Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

melt.data.table may crash when measure.vars contains variables not in data.table #699

Closed
vsalmendra opened this issue Jun 20, 2014 · 0 comments
Assignees
Milestone

Comments

@vsalmendra
Copy link

http://stackoverflow.com/questions/24326797/melt-data-table-may-crash-when-measure-vars-contains-variables-not-in-data-table

The following code crashes in my 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 is the 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 is the 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     
> 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

It may be the same problem reported here: http://stackoverflow.com/questions/20754791/melting-data-table-seems-to-crash-rstudio

@arunsrinivasan arunsrinivasan added this to the v1.9.4 milestone Jun 20, 2014
@arunsrinivasan arunsrinivasan self-assigned this Jun 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants