Learn R Programming

saotd (version 0.3.1)

merge_terms: Merge Terms

Description

Function to merge terms within a data frame and prevent redundancy in the analysis. For example many users may refer to the same entity in multiple different ways: President Trump, The U.S. President, POTUS, Trump, President Donald Trump, Donald Trump, etc. While each entry is different, they all refer to the same individual. Using Merge Terms will allow all be converted into a single term.

Usage

merge_terms(DataFrame, term, term_replacement, ignore_case = TRUE)

Value

A Tibble with user selected term replacement.

Arguments

DataFrame

Data Frame of Twitter Data.

term

Term selected for merging.

term_replacement

Desired replacement term.

ignore_case

True is the default setting and will ignore case sensitivity of the selected terms. Selecting FALSE will maintain case sensitivity.

Examples

Run this code
if (FALSE) {
library(saotd)
data <- raw_tweets
data <- merge_terms(DataFrame = data,
                    term = "ice cream",
                    term_replacement = "ice_cream")
data
}

Run the code above in your browser using DataLab