paleolimbot commented on a change in pull request #11133:
URL: https://github.com/apache/arrow/pull/11133#discussion_r708218864
##########
File path: r/R/dplyr-functions.R
##########
@@ -694,6 +694,14 @@ nse_funcs$wday <- function(x, label = FALSE, abbr = TRUE,
week_start = getOption
}
nse_funcs$log <- nse_funcs$logb <- function(x, base = exp(1)) {
+ if (inherits(base, "Expression")) {
+ return(Expression$create("logb_checked", x, base))
+ }
+
+ if (!is.numeric(base) || length(base) != 1) {
+ arrow_not_supported("base with length != 1")
+ }
+
Review comment:
It seems like other functions (e.g., send those computations to Arrow,
which also makes it slightly easier to do `log(2, base = column)`. Probs not
common with log but might be a more useful precedent for the next special-cased
binary function that gets added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]