dplyr:汇总函数中的min函数导致R崩溃

时间:2015-09-16 08:51:54

标签: r dplyr

由于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。如果我的问题可以重现,请告诉我,有什么方法可以解决这个问题吗?

0 个答案:

没有答案