Count - Cghlewis/data-wrangling-functions GitHub Wiki
While counting seems like it should be a fairly straightforward task, it can sometimes be more complicated than expected. And since in education research we are counting all the time (number of schools, number of teachers, number of students in classrooms, etc.) I think this is an important section to add.
Count cases and groups
- Count all cases
- Count cases per group
- Count distinct groups
- Count duplicates
- Calculate percent per group
Count strings
- [Count values in strings](See Strings)
Main functions used in examples
| Package | Functions |
|---|---|
| dplyr | count(); n() |
Other functions used in examples
| Package | Functions |
|---|---|
| dplyr | group_by(); summarize(); distinct(); n_groups(); n_distinct(); reframe() |
| base | round(); nrow() |
Resources