Skip to content

Commit bad1e32

Browse files
committed
cast a wider net for function matching
1 parent 16c3084 commit bad1e32

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

R/stat-summary-bin.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ make_summary_fun <- function(fun.data, fun, fun.max, fun.min, fun.args) {
108108
force(fun.min)
109109
force(fun.args)
110110

111+
as_function <- function(x) {
112+
if (is.character(x)) {
113+
x <- match.fun(x)
114+
}
115+
rlang::as_function(x)
116+
}
117+
111118
if (!is.null(fun.data)) {
112119
# Function that takes complete data frame as input
113120
fun.data <- as_function(fun.data)

0 commit comments

Comments
 (0)