subject_classify: Create a new logical variable that classifies meetings by...

View source: R/subject_classify.R

subject_classifyR Documentation

Create a new logical variable that classifies meetings by patterns in subject lines

Description

Take a meeting query with subject lines and create a new TRUE/FALSE column which classifies meetings by a provided set of patterns in the subject lines.

Usage

subject_classify(
  data,
  var_name = "class",
  keywords = NULL,
  pattern = NULL,
  ignore_case = FALSE,
  return = "data"
)

Arguments

data

A Meeting Query dataset in the form of a data frame.

var_name

String containing the name of the new column to be created.

keywords

Character vector containing the keywords to match.

pattern

String to use for regular expression matching instead of keywords. When both keywords and pattern are supplied, pattern takes priority and is used instead.

ignore_case

Logical value to determine whether to ignore case when performing pattern matching.

return

String specifying what output to return.

Examples

class_df <-
  mt_data %>%
  subject_classify(
    var_name = "IsSales",
    keywords = c("sales", "marketing")
  )

class_df %>% dplyr::count(IsSales)

# Return a table directly
mt_data %>% subject_classify(pattern = "annual", return = "table")


wpa documentation built on Aug. 21, 2023, 5:11 p.m.