-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_stack.R
34 lines (27 loc) · 932 Bytes
/
install_stack.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
# If private github packages are needed create a token by going to
# https://github.com/settings/tokens
# (Settings / Developer settings / Personal access token)
# Select the `repo` scope
# If your token is not stored as an environment variable
## Sys.setenv(GITHUB_PAT = "your_token")
# Do not share your token. It allows read/write access to your repositories
# Packages installation
if (file.exists("renv.lock")) {# Restore from a lockfile if it exists.
renv::restore(confirm = FALSE) # Do not ask for confirmation
} else { # Otherwise install the packages and make a lockfile
# CRAN packages
install.packages(c(
"remotes",
"tergmLite",
"EpiModel"
))
# Github packages
remotes::install_github(c(
"statnet/EpiModelHPC@257bbf3",
"statnet/EpiModelHIV@injectable-prep",
"EpiModel/ARTnetData@v1.2",
"EpiModel/ARTnet@v2.5.0"
))
# save the lockfile
renv::snapshot(type = "simple")
}