-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1-Load Packages.R
More file actions
48 lines (38 loc) · 1.87 KB
/
1-Load Packages.R
File metadata and controls
48 lines (38 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
################################################################################
# Amanda McGowin
# Thesis: An Analysis of Major Acquisition Reforms Through Text Mining and
# Grounded Theory Design
#
# 1. Install & Load Packages
#
# NOTE: Run scripts 1 through 3 prior to running analysis scripts
#
################################################################################
##########################################
# CHECK IF REQUIRED PACKAGES INSTALLED #
##########################################
package_required <- c("tidyverse", "stringr", "magrittr", "tidytext", "ldatuning",
"topicmodels", "tm", "wordcloud", "RColorBrewer", "igraph",
"widyr", "ggraph", "devtools")
packages_new <-
package_required[!(package_required %in% installed.packages()[,"Package"])]
if(length(packages_new)) install.packages(packages_new)
remove(package_required, packages_new)
#######################
# PACKAGES REQUIRED #
#######################
library(ggraph) # additional graphs for use with igraph
library(igraph) # network graphs for mapping word relationships
library(ldatuning) # estimation/tuning of LDA model parameter (k)
library(magrittr) # %>% for efficient code
library(stringr) # text cleaning and regular expressions
library(tidyverse) # data manipulation & plotting # INCLUDES: ggplot2,
# tibble, tidyr, readr, purrr, dplyr
library(tidytext) # provides additional text mining functions
library(topicmodels) # fitting data to LDA model (Gibbs)
library(RColorBrewer) # additional color palettes for graphs and charts
# library(widyr) # pairwise counting & correlation of related words
library(wordcloud) # plots word clouds using text data
library(devtools)
install_github("dgrtwo/drlib")
library(drlib)