-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_packages.R
38 lines (30 loc) · 1.47 KB
/
check_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
if (require(dplyr,quietly = TRUE)) {
message("The dplyr package has been installed")
} else {
message("The dplyr package has NOT been installed. Please try typing the command 'install.packages('dplyr')' again")
}
if (require(ggplot2,quietly = TRUE)) {
message("The ggplot2 package has been installed")
} else {
message("The ggplot2 package has NOT been installed. Please try typing the command 'install.packages('ggplot2')' again")
}
if (require(readr,quietly = TRUE)) {
message("The readr package has been installed")
} else {
message("The readr package has NOT been installed. Please try typing the command 'install.packages('readr')' again")
}
if (require(rmarkdown,quietly = TRUE)) {
message("The rmarkdown package has been installed")
} else {
message("The rmarkdown package has NOT been installed. Please try typing the command 'install.packages('rmarkdown')' again")
}
if (require(tidyr,quietly = TRUE)) {
message("The tidyr package has been installed")
} else {
message("The tidyr package has NOT been installed. Please try typing the command 'install.packages('tidyr')' again")
}
if (all(require(readr,quietly = TRUE) & require(dplyr,quietly = TRUE) & require(ggplot2,quietly = TRUE) & require(rmarkdown,quietly = TRUE) )){
message("You have successfully installed all the packages required for the course")
} else{
message("One of more of the required packages have not been installed. Please check the above messages and re-install the missing packages")
}