| Title: | 'textanalyzer', an R Package to Analyze Text |
|---|---|
| Description: | It analyzes text to create a count of top n-grams, including tokens (one-word), bigrams(two-word), and trigrams (three-word), while removing all stopwords. It also plots the n-grams and corresponding counts as a bar chart. |
| Authors: | Pushker Ravindra [aut, cre] |
| Maintainer: | Pushker Ravindra <[email protected]> |
| License: | GPL-3 |
| Version: | 0.2.0 |
| Built: | 2026-06-05 07:38:27 UTC |
| Source: | https://github.com/cran/textanalyzer |
Analyze text with ngram=2 (bigrams).
analyze_bigrams(in_text, top_rows = 25)analyze_bigrams(in_text, top_rows = 25)
in_text |
a character vector. Text to be analyzed as a character vector. |
top_rows |
a numeric vector of length 1. Number of top rows to be returned. |
analyze_bigrams
A data.frame with two columns - bigram (character vector) and count (numeric vector).
Ravindra Pushker
analyze_bigrams(in_text=c("The quick brown fox jumps over the lazy dog."))analyze_bigrams(in_text=c("The quick brown fox jumps over the lazy dog."))
Analyze text with ngram among 1, 2 or 3.
analyze_ngrams(in_text, ngram = 1, top_rows = 25)analyze_ngrams(in_text, ngram = 1, top_rows = 25)
in_text |
a character vector. Text to be analyzed as a character vector. |
ngram |
a numeric_vector of length 1. Ngram = 1, 2 or 3. |
top_rows |
a numeric vector of length 1. Number of top rows to be returned. |
analyze_ngrams
A data.frame with two columns - word/bigram/trigram (character vector) and count (integer vector).
Ravindra Pushker
analyze_ngrams(in_text=c("The quick brown fox jumps over the lazy dog."))analyze_ngrams(in_text=c("The quick brown fox jumps over the lazy dog."))
Analyze text with ngram=1
analyze_tokens(in_text, top_rows = 25)analyze_tokens(in_text, top_rows = 25)
in_text |
a character vector. Text to be analyzed as a character vector. |
top_rows |
a numeric vector of length 1. Number of top rows to be returned. |
analyze_tokens
A data.frame with two columns - word (character vector) and count (numeric vector).
Ravindra Pushker
analyze_tokens(in_text=c("The quick brown fox jumps over the lazy dog."))analyze_tokens(in_text=c("The quick brown fox jumps over the lazy dog."))
Analyze text with ngram=3 (trigrams).
analyze_trigrams(in_text, top_rows = 25)analyze_trigrams(in_text, top_rows = 25)
in_text |
a character vector. Text to be analyzed as a character vector. |
top_rows |
a numeric vector of length 1. Number of top rows to be returned. |
analyze_trigrams
A data.frame with two columns - trigram (character vector) and count (numeric vector).
Ravindra Pushker
analyze_trigrams(in_text=c("The quick brown fox jumps over the lazy dog."))analyze_trigrams(in_text=c("The quick brown fox jumps over the lazy dog."))
Plot ngrams - Word(s) vs. Count.
plot_ngrams(ngrams_data, top_rows = 25, plot_nrows = 25)plot_ngrams(ngrams_data, top_rows = 25, plot_nrows = 25)
ngrams_data |
a data.frame containing word and n columns. |
top_rows |
a numeric vector of length 1. Number of top rows to be returned. |
plot_nrows |
a numeric vector of length 1. Number of rows to be plotted. |
plot_ngrams
A ggplot plot object of bar chart with words and their counts.
Ravindra Pushker
plot_ngrams(data.frame(word=c("test1", "test2"), n=c(25, 30)))plot_ngrams(data.frame(word=c("test1", "test2"), n=c(25, 30)))