paleolimbot commented on a change in pull request #11133:
URL: https://github.com/apache/arrow/pull/11133#discussion_r706438885
##########
File path: r/R/dplyr-functions.R
##########
@@ -694,6 +694,10 @@ 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))
+ }
+
Review comment:
Pretty sure the `inherits()` is OK, but if base is not a column and
length != 1 I imagine we'd want to error? You could theoretically do
`mutate(new_col = log(x, base = 1:10))` in R but I imagine that's not worth
supporting?
``` r
inherits(1:10, "Expression")
#> [1] FALSE
```
--
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]