1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 18:41:58 +02:00

(v1.7.1.9024) unit tests

This commit is contained in:
2021-08-17 14:34:11 +02:00
parent a2d249962f
commit a44283f998
99 changed files with 550 additions and 501 deletions

Binary file not shown.

View File

@ -27,26 +27,13 @@
install.packages("data-raw/tinytest_1.2.4.10.tar.gz")
install.packages("data-raw/AMR_latest.tar.gz", dependencies = FALSE)
pkg_to_install <- c("cleaner",
"curl",
"dplyr",
"ggplot2",
"ggtext",
"knitr",
"microbenchmark",
"pillar",
"readxl",
"rmarkdown",
"rstudioapi",
"rvest",
"skimr",
"tidyr",
"tinytest",
"vctrs",
"xml2" )
cat("Packages to install:", paste(pkg_to_install, collapse = ", "), "\n")
pkg_suggests <- gsub("[^a-zA-Z0-9]+", "",
unlist(strsplit(unlist(packageDescription("AMR",
fields = c("Suggests", "Enhances"))),
", ?")))
cat("Packages listed in Suggests/Enhances:", paste(pkg_suggests, collapse = ", "), "\n")
to_install <- pkg_to_install[!pkg_to_install %in% rownames(utils::installed.packages())]
to_install <- pkg_suggests[!pkg_suggests %in% rownames(utils::installed.packages())]
if (length(to_install) == 0) {
message("\nNothing to install\n")
}
@ -59,7 +46,7 @@ for (i in seq_len(length(to_install))) {
}
to_update <- as.data.frame(utils::old.packages(repos = "https://cran.rstudio.com/"), stringsAsFactors = FALSE)
to_update <- to_update[which(to_update$Package %in% pkg_to_install), "Package", drop = TRUE]
to_update <- to_update[which(to_update$Package %in% pkg_suggests), "Package", drop = TRUE]
if (length(to_update) == 0) {
message("\nNothing to update\n")
}