eitsupi commented on code in PR #35702:
URL: https://github.com/apache/arrow/pull/35702#discussion_r1202119172
##########
r/vignettes/data_wrangling.Rmd:
##########
@@ -165,6 +165,33 @@ sw2 %>%
transmute(name, height, mass, res = residuals(lm(mass ~ height)))
```
+Because window functions are not supported, computing an aggregation like
`mean()` on a grouped table or within a rowwise opertation like `filter()` is
not supported:
+
+```{r}
+sw %>%
+ select(1:4) %>%
+ filter(!is.na(hair_color)) %>%
+ group_by(hair_color) %>%
+ filter(height < mean(height, na.rm = TRUE))
+```
+
+This operation can be accomplished in arrow by computing the aggregation
separately, for example within a join operation:
+
+```{r}
+sw %>%
+ select(1:4) %>%
+ filter(!is.na(hair_color)) %>%
+ left_join(
+ sw %>%
+ group_by(hair_color) %>%
+ summarize(mean_height = mean(height, na.rm = TRUE))
+ ) %>%
+ filter(height < mean_height) %>%
Review Comment:
```suggestion
sw %>%
group_by(hair_color) %>%
summarize(mean_height = mean(height, na.rm = TRUE))
) %>%
filter(height < mean_height) %>%
```
Sorry, I missed white spaces.
```log
Warning:
file=vignettes\data_wrangling.Rmd,line=185,col=11,[trailing_whitespace_linter]
Trailing whitespace is superfluous.
Warning:
file=vignettes\data_wrangling.Rmd,line=187,col=58,[trailing_whitespace_linter]
Trailing whitespace is superfluous.
Warning:
file=vignettes\data_wrangling.Rmd,line=189,col=35,[trailing_whitespace_linter]
Trailing whitespace is superfluous.
```
https://github.com/apache/arrow/actions/runs/5051256053/jobs/9064773094#step:11:73
--
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]