diff --git a/numbers.qmd b/numbers.qmd index 197dd2b..e1fff77 100644 --- a/numbers.qmd +++ b/numbers.qmd @@ -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) ```