sentiment_analysis: sentiment_analysis

Description Usage Arguments Value Examples

View source: R/tweetr.R

Description

This function takes a tweet dataframe as input. The input dataframe should contain a column named 'tweet' that contains tweet text information. The function cleans the text inn 'tweet' column by removing http component, punctuation, end words, reduce the letters to lowercase and word stemming. Then the function matches each word to the sentiment 'positive' or 'negative' using the tidytext 'Bing' lexicons. And output is a dataframe that contains words used in the tweet texts and assign each word with either 'positive' or 'negative' sentiment plus sorting by the numbers of appearence of that word.

Usage

1

Arguments

tweet

data.frame

Value

tweet_result data.frame

Examples

1
2
tweet_data <- tweetr::brunomars_tweet
sentiment_analysis(tweet_data)

UBC-MDS/tweetr documentation built on March 21, 2021, 7:14 p.m.