Count and calculate proportion of each group
Examples
mock_forager() |>
count_prop(payer, sort = TRUE)
#> # A tibble: 7 × 3
#> payer n prop
#> <fct> <int> <dbl>
#> 1 Medicare 3 0.3
#> 2 Cigna 2 0.2
#> 3 BCBS 1 0.1
#> 4 Centene 1 0.1
#> 5 Humana 1 0.1
#> 6 MAO 1 0.1
#> 7 Medicaid 1 0.1
