count_mentions: Count mentions

Description Usage Arguments Value Methods (by class) Examples

View source: R/mentions_count.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
count_mentions(.account, ...)

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

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

## S3 method for class '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)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 

# 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)


## End(Not run)

## Not run: 
  count_mentions("TEST01AA", "published inthelast week", groupBy = c("published"))

## End(Not run)


## Not run: 
account("TEST01AA", "TEST02AA") %>%
  filter_mentions("published inthelast week") %>%
  group_mentions_by(published) %>%
  count_mentions()

## End(Not run)

brandseye/brandseyer2 documentation built on Sept. 5, 2021, 2:15 p.m.