Skip to contents

This takes a tibble and a field name and does a group_by that field and counts the results

Usage

counts_fields(data, field_name)

Arguments

data

The tibble to count groups

field_name

The name of the field to group and count

Details

Group a dataset by a field and provide the counts of each group

Examples

library(rolemapr)
library(tibble)

practice_data <- tribble(
   ~practice_area, ~role,
   "Test area", "Test Role",
 )
counts_fields(practice_data, "practice_area")
#> # A tibble: 1 × 2
#> # Groups:   practice_area [1]
#>   practice_area     n
#>   <chr>         <int>
#> 1 Test area         1