-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0_install_pkgs.R
27 lines (23 loc) · 999 Bytes
/
0_install_pkgs.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
# Install and import essential packages -----------------------------------
install.packages("tidyverse")
# library(tidyverse) will import ggplot2, dplyr, tidyr, readr, purrr, and tibble
# Need to library
# readxl for .xls and .xlsx sheets.
# haven for SPSS, Stata, and SAS data.
# jsonlite for JSON.
# xml2 for XML.
# httr for web APIs.
# rvest for web scraping.
# stringr for strings.
# lubridate for dates and date-times.
# forcats for categorical variables (factors).
# hms for time-of-day values.
# blob for storing blob (binary) data.
# packages for lecture hand-in-hand R
pkgs <- c("tidyverse", "jiebaR", "data.table", "text2vec", "fmsb",
"rjson", "rpart", "randomForest", "ggmap",
"zoo", "twitteR", "tidytext", "tm", "wordcloud", "igraph", "rgexf", "topicmodels", "RTextTools", "tmcn", "tidyr")
# excluded packages not in the computer
pkgs <- pkgs[!(pkgs %in% installed.packages()[,"Package"])]
if(length(pkgs)) install.packages(pkgs)
install.packages("tidyverse")