-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackrat_setup.R
67 lines (56 loc) · 1.21 KB
/
packrat_setup.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
if(!require("packrat")){
install.packages("packrat", repos = "https://cran.rstudio.com/")
library(remotes)
}
packrat::init(
infer.dependencies = FALSE,
enter = TRUE,
restart = FALSE)
#### Setup repositories ----
# Install packages that install packages.
install.packages("remotes", repos = "https://cran.rstudio.com/")
# Set repos.
my_repos <- vector()
my_repos["CRAN"] <- "https://cran.rstudio.com/"
options(repos = my_repos)
#### Install CRAN packages ----
cran_packages <- c(
"conflicted",
"dplyr",
"dotenv",
"drake",
"ggplot2",
"govstyle",
"patchwork",
"purrr",
"here",
"janitor",
"knitr",
"lubridate",
"magrittr",
"openxlsx",
"scales",
"stringr",
"tidyr",
"readr",
"rgeos",
"forcats",
"zoo",
"rnaturalearth",
"rnaturalearthdata",
"ggrepel",
"sf",
"systemfonts",
"xtable"
)
install.packages(cran_packages)
#### Install github packages ----
github_packages <- c(
"ukgovdatascience/govstyle"
)
remotes::install_github(github_packages)
#### Take snapshot ----
packrat::snapshot(
snapshot.sources = FALSE,
ignore.stale = TRUE,
infer.dependencies = FALSE)