contentAnalysis: Perform Content Analysis

Description Usage Arguments Value Examples

Description

Perform content analysis; build LDA model on abstract text

Usage

1
contentAnalysis(articles_df, k, words_to_remove)

Arguments

articles_df

Dataframe of articles. Output from getArticles() function.

k

Number of topics

words_to_remove

(Optional) Additional stopwords to be removed

Value

List

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
content <- contentAnalysis(articles_df =  articles_df, k = 10)

# Add your own stop words
words_to_remove <- c("stopword1", "stopword2")
content <- contentAnalysis(articles_df =  articles_df, k = 10, words_to_remove = words_to_remove)

# Word cloud
wordCloud(content)

# Top words in corpus
topNWordsInDoc(content, n = 10)

# Plot top words
topNWordsInDoc(content, n = 10, plot = TRUE)

# Top n words in topics
topNWordsInTopic(content, n = 3)

# Plot top n words in topics
topNWordsInTopic(content, n = 3, plot = TRUE)

rvidgen/clr documentation built on May 28, 2019, 10:42 a.m.