knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "images/",
  out.width = "100%"
)

texter

The goal of texter is to help simplify text analysis for data professionals who need quick insights into their text data.

Installation

This package is in its testing phasing and as not been submitted to CRAN.

The development version from GitHub can be installed with:

# install.packages("devtools")
#devtools::install_github("simmieyungie/texter")
remotes::install_github("simmieyungie/texter@main")
#remove.packages(texter)

Example

This is a basic example which shows you how to solve a common problem:

library(texter)
## basic example code

Users

This will help you extract all the handles tagged in a tweet.

head(unlist(users(doge$text)),5)

Sentiment Analyzer

The emotions conveyed tweets using sentiment analysis. You have an option to specify details = TRUE (or FALSE). TRUE will return a more robust distribution of sentiments and not just Positive or Negative.

sentimentAnalyzer(doge$text, details = T)

Specifying details = F

sentimentAnalyzer(doge$text, details = F)

top_words

Extract the top n words occurring in a text

top_words(word_vec = brexit$content, remove_these = c("london", "since"),
          size = 10)

Counter

Retrieve the frequency of a word from a text.

counter(word_vec = brexit$content, words = c("brexit", "london"))

top_sentiments

Retrieve the top 10 positive and negative words. Specify plot = TRUE and a simple bar chart of the words will be created, otherwise you get a dataframe of results.

top_Sentiments(word_vec = brexit$content, plot = F)
top_Sentiments(word_vec = doge$text, plot = T) #You can further customize your plot

top_words_retriever

Retrieve the top n words occurring in a rows of data containing a certain word

top_words_Retriever(word_vec = brexit$content, word_ret = "brexit",
                    remove_these = c("eu", "rt"), size = 10)

top_bigrams

Retrieve top n bigrans occuring in a corpus

top_bigrams(brexit %>% select(content), remove_these = c("tmsnrsegbfvh", "รข"), bigram_size = 10)


simmieyungie/texter documentation built on Dec. 23, 2021, 2:23 a.m.