subject_scan {wpa} | R Documentation |
Count top words in subject lines grouped by a custom attribute
Description
This function generates a matrix of the top occurring words in meetings, grouped by a specified attribute such as organisational attribute, day of the week, or hours of the day.
Usage
subject_scan(
data,
hrvar,
mode = NULL,
top_n = 10,
token = "words",
return = "plot",
weight = NULL,
stopwords = NULL,
...
)
tm_scan(
data,
hrvar,
mode = NULL,
top_n = 10,
token = "words",
return = "plot",
weight = NULL,
stopwords = NULL,
...
)
Arguments
data |
A Meeting Query dataset in the form of a data frame. |
hrvar |
String containing the name of the HR Variable by which to split
metrics. Note that the prefix |
mode |
String specifying what variable to use for grouping subject words. Valid values include:
|
top_n |
Numeric value specifying the top number of words to show. |
token |
A character vector accepting either |
return |
String specifying what to return. This must be one of the following strings:
See |
weight |
String specifying the column name of a numeric variable for
weighting data, such as |
stopwords |
A character vector OR a single-column data frame labelled
|
... |
Additional parameters to pass to |
Value
A different output is returned depending on the value passed to the return
argument:
-
"plot"
: 'ggplot' object. A heatmapped grid. -
"table"
: data frame. A summary table for the metric. -
"data"
: data frame.
Examples
# return a heatmap table for words
mt_data %>% subject_scan(hrvar = "Organizer_Organization")
# return a heatmap table for ngrams
mt_data %>%
subject_scan(
hrvar = "Organizer_Organization",
token = "ngrams",
n = 2)
# return raw table format
mt_data %>% subject_scan(hrvar = "Organizer_Organization", return = "table")
# grouped by hours
mt_data %>% subject_scan(mode = "hours")
# grouped by days
mt_data %>% subject_scan(mode = "days")