由于tbl_df
:
filter
library(dplyr)
df <- tbl_df(data.frame(A=c(1)))
df <- df %>% filter(A > 1)
我想summarise
这个堕落的tbl_df
:
df %>% summarise(Mean=mean(A, na.rm=T))
这很好用:
Source: local data frame [1 x 1]
Mean
1 NaN
但min
函数导致崩溃:
df %>% summarise(Min=min(A, na.rm=T))
在RStudio中它将终止R会话,但在R命令行中我得到了更多细节:
*** caught segfault ***
address 0xb8599d8, cause 'memory not mapped'
Traceback:
1: .Call("dplyr_summarise_impl", PACKAGE = "dplyr", df, dots)
2: summarise_impl(.data, dots)
3: summarise_.tbl_df(.data, .dots = lazyeval::lazy_dots(...))
4: summarise_(.data, .dots = lazyeval::lazy_dots(...))
5: summarise(., Min = min(A, na.rm = T))
6: function_list[[k]](value)
7: withVisible(function_list[[k]](value))
8: freduce(value, `_function_list`)
9: `_fseq`(`_lhs`)
10: eval(expr, envir, enclos)
11: eval(quote(`_fseq`(`_lhs`)), env, env)
12: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
13: df %>% summarise(Min = min(A, na.rm = T))
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:
我与max
有类似的崩溃,我不知道是否有更多功能遇到麻烦。
我的dplyr
版本为0.4.2
,R版本为3.2.2
,操作系统为Ubuntu 14.04。如果我的问题可以重现,请告诉我,有什么方法可以解决这个问题吗?