Numbers tweaks
This commit is contained in:
parent
fb80197bf7
commit
2316168cd4
|
@ -104,9 +104,7 @@ There are a couple of variants of `n()` that you might find useful:
|
|||
```{r}
|
||||
flights |>
|
||||
group_by(dest) |>
|
||||
summarize(
|
||||
carriers = n_distinct(carrier)
|
||||
) |>
|
||||
summarize(carriers = n_distinct(carrier)) |>
|
||||
arrange(desc(carriers))
|
||||
```
|
||||
|
||||
|
@ -122,6 +120,7 @@ There are a couple of variants of `n()` that you might find useful:
|
|||
Weighted counts are a common problem so `count()` has a `wt` argument that does the same thing:
|
||||
|
||||
```{r}
|
||||
#| results: false
|
||||
flights |> count(tailnum, wt = distance)
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue