bwr_mentions_chart {brandwatchR}R Documentation

Get a dataframe of chart-ready data for a specified Brandwatch query or query group

Description

For more information, please refer to https://developers.brandwatch.com/docs/chart-dimensions-and-aggregates

Usage

bwr_mentions_chart(project_id = NULL, query_id = NULL,
  querygrp_id = NULL, date_range = c(Sys.Date() - 31, Sys.Date() - 1),
  aggregate = NULL, dimension1 = NULL, dimension2 = NULL,
  filters = NULL, token = Sys.getenv("BW_TOKEN"))

Arguments

project_id

The project id in which the specified query is contained. Obtain a list of project IDs using bwr_get_projects().

query_id

The query ID you'd like to see tweeter data for. Note that you can only specify a query or a query group, not both.

querygrp_id

The query group ID you'd like to see total mentions for. Note that you can only specify a query or a query group, not both.

date_range

A character vector containing 2 date values in YYYY-mm-dd format. The first value is the beginning of your desired date range and the second value is the end of the date range.

aggregate

The numeric variable which you'd like to return results for (e.g. 'volume')

dimension1

The first dimension which you'd like to split your data by (e.g. 'months')

dimension2

The second dimension which you'd like to split your data by (e.g. 'countries')

filters

(Optional) A list of key-value pairs to filter the mentions query by. Use the bwr_filters_get() function to find out all available filters.

token

The authentication token, acquired using bwr_auth()

Value

Returns a data frame (including some list-columns) of the JSON results, aggregated according to your 2 dimensions.

Examples

## Not run: my_project <- bwr_projects_get()$id[1]
my_query <- bwr_query_get(project_id = my_project)$id[1]
my_mentions_chart <- bwr_mentions_chart(project_id = my_project,
                                        query_id = my_query,
                                        date_range = c('2018-01-01', '2018-02-01'),
                                        aggregate = "month",
                                        dimension1 = "sentiment",
                                        dimension2 = "volume")
## End(Not run)

[Package brandwatchR version 0.3.0 Index]