Hi there,
Here is an example below of how to accomplish something like that with this dummy dataset. As you can see here we group the different species and count that number of observations while also working out their mean sepal lengths. You can do something smiliar for your data.
library(tidyverse)
iris %>%
group_by(Species) %>%
summarise(count_species = n(), average_sepal_length = mean(Sepal.Length))
#> # A tibble: 3 x 3
#> Species count_species average_sepal_length
#> <fct> <int> <dbl>
#> 1 setosa 50 5.01
#> 2 versicolor 50 5.94
#> 3 virginica 50 6.59
Created on 2021-10-22 by the reprex package (v2.0.0)