Hi, I had a memory bug when I tried to run the following script that wants to select a subset rows of data.table, the bug is somehow fixed by making a copy of the input data.table however:
library(data.table)
load('test_bug.RData')
Test.Bug <- function(tmp_move, ID){
print(ID)
#tmp_move <- copy(tmp_move)
coverage <- tmp_move[, .(c.count= sum(dummy== 0)), by= group]
groups_selected <- unique(coverage[c.count>120, group])
tmp_move2 <- tmp_move[group %in% groups_selected]
return(tmp_move2)
}
move[, Test.Bug(.SD, ID), by= ID]
*** caught segfault ***
address 0x7fc3910d2824, cause 'memory not mapped'
Traceback:
1: bmerge(i, x, leftcols, rightcols, io <- FALSE, xo, roll = 0,
rollends = c(FALSE, FALSE), nomatch = 0L, verbose = verbose)
2: `[.data.table`(tmp_move, group %in% groups_selected)
3: tmp_move[group %in% groups_selected]
4: Test.Bug(.SD, ID)
5: `[.data.table`(move, , Test.Bug(.SD, ID), by = ID)
6: move[, Test.Bug(.SD, ID), by = ID]
--
Zhida(George) Gui
Mathematics and Economics Major
Email:[email protected]
Cell:773-614-2597
test_bug.R
Description: Binary data
test_bug.RData
Description: Binary data
_______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
