Count the number of topics by theme and by date

count_topics(topics, by_date = c("month_year", "year", "all"), .sort = TRUE)

Arguments

topics

A tibble of topics by theme from en-net forum produced through a call to get_themes_topics().

by_date

Should topics be grouped by month of the year or just by year or overall? Default is to group by month of the year.

.sort

Logical. Should output be sorted by count frequencies? Default is TRUE.

Value

A tibble of topic counts by theme and by specified date format

Author

Ernest Guevarra

Examples

library(magrittr)
ennet_topics %>% count_topics(by_date = "month_year")
#> Warning: This function is now deprecated and will be removed in the next version of the
#> package. Consider using the function ennet::count_topics_theme() instead.
#> # A tibble: 894 × 4
#>    Theme                Month  Year     n
#>    <chr>                <fct> <dbl> <int>
#>  1 Adolescent nutrition Mar    2021    14
#>  2 Adolescent nutrition Jun    2018     6
#>  3 Adolescent nutrition Jul    2018     2
#>  4 Adolescent nutrition Feb    2020     1
#>  5 Adolescent nutrition Feb    2021     1
#>  6 Adolescent nutrition May    2018     1
#>  7 Adolescent nutrition Jun    2020     1
#>  8 Adolescent nutrition Jul    2021     1
#>  9 Adolescent nutrition Aug    2018     1
#> 10 Adolescent nutrition Aug    2021     1
#> # … with 884 more rows