Counts mentions, aggregating them in to various data sets. See the query() language to conveniently specify what to count.

count_mentions(.account, ...)

# S3 method for brandseyer2.account.v4
count_mentions(
  .account,
  filter,
  ...,
  groupBy = NULL,
  select = NULL,
  orderBy = NULL,
  tagNamespace = NULL,
  .envir = parent.frame()
)

# S3 method for character
count_mentions(
  .account,
  filter,
  ...,
  timezone = "Africa/Johannesburg",
  groupBy = NULL,
  select = NULL,
  orderBy = NULL,
  tagNamespace = NULL
)

# S3 method for brandseyer2.query
count_mentions(
  .account,
  ...,
  tagNamespace = NULL,
  .show.progress = interactive()
)

Arguments

.account

An account to read from

...

Further arguments for other methods

filter

A filter to use

groupBy

An optional list of names of things to group by. For example, groupBy = published, or, groupBy = tag

select

An optional list of names of things to select and aggregate by, in addition to the number of mentions. For example, select = totalSentiment, or, select = c(totalSentiment, totalEngagement).

orderBy

An optional list of names of the aggregate fields to order the results by.

tagNamespace

An optional string. When grouping by tag, tagNamespace can be supplied to limit the tags being grouped by to only those in the given namespace. For example, to only see topics, have tagNamespace = 'topic'

.envir

An optional environment in which to evaluate variables in your groupBy, select, and orderBy arguments.

timezone

A character vector indicating the timezone that dates are reported in. This should usually be the account's timezone.

.show.progress

A logical value to indicate whether to show a progress bar or not. Defaults to showing the progress bar in interactive settings. In addition, the progress bar will only be shown when counting mentions for more than three accounts at a time.

Value

A tibble of data.

Methods (by class)

  • brandseyer2.account.v4: Count mentions in a v4 account.

  • character: Allows you to fetch mentions using raw fields. All fields are dynamically created (such as groupBy) are, in this version of the function, character vectors.

  • brandseyer2.query: Count mentions using a query().

Examples

if (FALSE) { # Count all mentions in your account in the last year account("TEST01AA") %>% count_mentions("published inthelast year and brandisorchildof 1") # Count all mentions in your account, grouping by publication date. account("TEST01AA") %>% count_mentions("published inthelast year and brandisorchildof 1", groupBy = published) } if (FALSE) { count_mentions("TEST01AA", "published inthelast week", groupBy = c("published")) } if (FALSE) { account("TEST01AA", "TEST02AA") %>% filter_mentions("published inthelast week") %>% group_mentions_by(published) %>% count_mentions() }