Remember y'all, if you want to `dplyr::summarise` after testing a condition, do `dplyr::filter` first, not try and put the logic in the summarize command itself, where you will end up summarizing on a logical vector instead of the data itself.

#RStats

@rmflight What is the basis for this? Example?

@job_n My motivating example was the plot below:

There are a **lot** of values with 0 standard deviation in this plot (solid lines at left). I want to get summaries of these distributions, both with and without the zeros included.

```
data |>
summarize(mean_all = mean(sd), mean_no0 = mean(sd > 0))
```

Was what I first tried.

But really, I wanted:

```
all_summary = data |>
summarize(mean_all = mean(sd))

no0_summary = data |>
filter(sd > 0) |>
summarize(mean_no0 = mean(sd))
```

@rmflight Wao, thanks for the insight. I always thought that mean() will always exclude 0 entries!

@job_n Where would you get information that it works that way? Nothing in the documentation of `mean` suggests that.

It's easy to test

```
mean(c(1, 2, 3))
mean(c(0, 1, 2, 3))
```