add_tally and add_count returns the count of rows similar to count( ).
add_tally() adds a column n to a table based on the number of items within each existing group, while add_count() is a shortcut that does the grouping as well.
add_tally(x, wt, sort = FALSE, name = "n")
add_count(x, ..., wt = NULL, sort = FALSE, name = "n")
mtcars %>% add_count(cyl)
mtcars %>% group_by(cyl) >%> add_tally()
Hope it helps!