You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/25 09:38:45 UTC

[GitHub] [arrow] thisisnic commented on a change in pull request #10996: ARROW-13528: [R] Bindings for mean, var, sd aggregation

thisisnic commented on a change in pull request #10996:
URL: https://github.com/apache/arrow/pull/10996#discussion_r695580678



##########
File path: r/R/dplyr-functions.R
##########
@@ -808,3 +808,25 @@ agg_funcs$all <- function(x, na.rm = FALSE) {
     options = list(na.rm = na.rm, na.min_count = 0L)
   )
 }
+
+agg_funcs$mean <- function(x, na.rm = FALSE) {
+  list(
+    fun = "mean",
+    data = x,
+    options = list(na.rm = na.rm, na.min_count = 0L)
+  )
+}
+agg_funcs$sd <- function(x, na.rm = FALSE) {
+  list(
+    fun = "stddev",
+    data = x,
+    options = list(ddof = 1)

Review comment:
       I've manually set `ddof` here, similarly to how we've manually set `na.min_count` without exposing this to the end user, but actually, would it make sense to add it as an argument with a default value of `1`?  I could see `ddof` (i.e. delta degrees of freedom) maybe being useful in some statistical contexts.
   
   What governs whether we just mimic existing R behaviour vs. expose Arrow's additional functionality?




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org