Run_Sentiment_Analysis: Sentiment Analysis

View source: R/Run_Sentiment_Analysis.R

Run_Sentiment_AnalysisR Documentation

Sentiment Analysis

Description

This function conducts a Sentiment analysis on data from a csv file, comprised of one column of text. Each cell in that column must be an independent tweet, review, or document.

Usage

Run_Sentiment_Analysis(
  mydata,
  words2remove,
  stemthis = FALSE,
  wcmf = 5,
  mostfrequent = 25
)

Arguments

mydata

A .csv file to be analyzed. Each line must be a separate text: a tweet, review, or document.

words2remove

A vector of words to remove from the analysis because of their irrelevance.

stemthis

To stem the documents or not to stem: default = FALSE, you can set it to TRUE

wcmf

Word Cloud Minimum Frequency: default = 5. Words with frequencies lower than this amount will not be displayed in the word cloud

mostfrequent

Number of most frequent words to display, default = 25

Examples

## Not run: 
# You need to have one csv file containing one column of text with a column header.
# Each cell in this file after the first cell will be a tweet, review, or document...
# The next few lines prepare and run the analysis.
# This is the sample code to be copied and used in a new R Script:
library(listentodata)
clear_console()
mydata = load_csv_data()
words2remove = c("toremvoe1", "toremove2")
stemthis = FALSE
wcmf = 5 # Word Cloud Minimum Frequency: default = 5
mostfrequent = 25
Run_Sentiment_Analysis(mydata, words2remove, stemthis, wcmf, mostfrequent)

## End(Not run)

1moein/listentodata documentation built on Nov. 14, 2024, 5:35 p.m.