-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
The following code (see attached file for the data)
library(data.table)
load("example.RData")
col = "ground.temp.min"
filter.zeros.thresh.K = 3
obs[.(check.regions$stn, check.regions$date), by = check.regions$g, (col) :=
{v = get(col)
if (!any(!is.na(v) &
!zero &
abs(v) <= filter.zeros.thresh.K))
v[date == median(date)] = NA
v}]
causes this segfault:
*** caught segfault ***
address 0x56386f5fd8dc, cause 'memory not mapped'
Traceback:
1: `[.data.table`(obs, .(check.regions$stn, check.regions$date), by = check.regions$g, `:=`((col), { v = get(col) if (!any(!is.na(v) & !zero & abs(v) <= filter.zeros.thresh.K)) v[date == median(date)] = NA v }))
2: obs[.(check.regions$stn, check.regions$date), by = check.regions$g, `:=`((col), { v = get(col) if (!any(!is.na(v) & !zero & abs(v) <= filter.zeros.thresh.K)) v[date == median(date)] = NA v })]
sessionInfo
is:
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.13.6
loaded via a namespace (and not attached):
[1] compiler_4.0.2
myoung3 and mattdowledantonnoriega