-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_install_packages.R
90 lines (78 loc) · 1.61 KB
/
01_install_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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# The aim of this code is to install
# the packages used by this package either to build it, run it or to create the package data
# Update R ad R studio
#installr::updateR()
# change to local library as needed
project_lib <- "C:/Users/cm1dog/Documents/R"
# Create library directory if needed
if(!dir.exists(project_lib)) {dir.create(project_lib)}
.libPaths(project_lib)
###########################
# CRAN packages
# Package names
packages <- c(
"boot",
"bit64",
"bookdown",
"crayon",
"cowsay",
"curl",
"cowplot",
"dvmisc",
"DiagrammeR",
"data.table",
"DirichletReg",
"demography",
"dplyr",
"devtools",
"flextable",
"fastmatch",
"forecast",
"ggplot2",
"ggthemes",
"git2r",
"getPass",
"Hmisc",
"here",
"ids",
"knitr",
"lifecycle",
"magrittr",
"mice",
"nnet",
"openxlsx",
"praise",
"parallel",
"plyr",
"readxl",
"roxygen2",
"readr",
"Rdpack",
"readODS",
"Rfast",
"rmarkdown",
"raster",
"RColorBrewer",
"stats",
"survey",
"stringr",
"snowfall",
"testthat",
"tidyverse",
"TTR",
"usethis",
"utils",
"VGAM",
"viridis",
"writexl")
# Install packages not yet installed
installed_packages <- packages %in% rownames(installed.packages())
if (any(installed_packages == FALSE)) {
#install.packages(packages[!installed_packages], type = "source", INSTALL_opts = "--byte-compile")
install.packages(packages[!installed_packages], lib = project_lib)
#install.packages(packages[!installed_packages])
}
# Install the hseclean package
devtools::install_git(
"https://github.com/stapm/hseclean.git",
build_vignettes = FALSE, quiet = TRUE)