-
Notifications
You must be signed in to change notification settings - Fork 3
/
packages.r
25 lines (23 loc) · 1.15 KB
/
packages.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
# install packages from CRAN
p_needed <- c("readr", # imports spreadsheet data
"haven", # imports SPSS, Stata and SAS files
"magrittr", # for piping
"plyr", # for consistent split-apply-combines
"dplyr", # provides data manipulating functions
"stringr", # for string processing
"ggplot2", # for graphics
"tidyr", # for tidying data frames
"broom", # for tidying model output
"janitor", # for basic data tidying and examinations
"reshape2", # reshape data
"xtable", # generate table output
"stargazer", # generate nice model table
"babynames", # dataset compiled by Hadley Wickham; contains US baby names provided by the SSA and data on all names used for at least 5 children of either sex
"nycflights13" # data set on all 336776 flights departing from NYC in 2013
)
packages <- rownames(installed.packages())
p_to_install <- p_needed[!(p_needed %in% packages)]
if (length(p_to_install) > 0) {
install.packages(p_to_install)
}
lapply(p_needed, require, character.only = TRUE)