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/04/30 15:50:56 UTC

[GitHub] [arrow] thisisnic commented on a change in pull request #10215: ARROW-12199: [R] bindings for stddev, variance

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



##########
File path: r/R/dplyr.R
##########
@@ -480,6 +480,18 @@ build_function_list <- function(FUN) {
     between = function(x, left, right) {
       x >= left & x <= right
     },
+    sd = function(x, na.rm = FALSE){
+      if (!na.rm && x$null_count > 0) {
+        return(Scalar$create(NA_real_))
+      }

Review comment:
       I'm not sure if this is wrong somehow, as when I call the code below, I get the warning `Warning: Expression mass - sd(mass, na.rm = FALSE) not supported in Arrow; pulling data into R`, but yet when I set `na.rm` to TRUE, I don't.
   ```
   Table$create(starwars) %>%
        select(name, mass, species) %>%
        mutate(mass_diff = mass-sd(mass, na.rm = FALSE)) %>%
        collect()
   ```




-- 
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.

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