-
Notifications
You must be signed in to change notification settings - Fork 10
/
installAndLoadAllPackages.R
30 lines (28 loc) · 881 Bytes
/
installAndLoadAllPackages.R
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
twitteR = "twitteR"
if (!require(twitteR, character.only=T, quietly=T)) {
install.packages(c("devtools", "rjson", "bit64", "httr"))
library(devtools)
install_github("geoffjentry/twitteR")
library(twitteR)
}
rm(twitteR)
ggplot2 = "ggplot2"
if (!require(ggplot2, character.only=T, quietly=T)) {
install.packages('ggplot2', dep = TRUE)
require(ggplot2)
}
rm(ggplot2)
sentiment = "sentiment"
if (!require(sentiment, character.only=T, quietly=T)) {
install.packages("Rstem", repos = "http://www.omegahat.org/R", type="source")
install_url("http://cran.r-project.org/src/contrib/Archive/sentiment/sentiment_0.2.tar.gz")
require(sentiment)
ls("package:sentiment")
}
rm(sentiment)
for (package in c('tm', 'wordcloud', 'tau')) {
if (!require(package, character.only=T, quietly=T)) {
install.packages(package)
library(package, character.only=T)
}
}