1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 14:01:55 +02:00

(v1.3.0.9023) optimalisation

This commit is contained in:
2020-09-19 11:54:01 +02:00
parent 4e40e42011
commit d049cce69b
30 changed files with 104 additions and 578 deletions

View File

@ -19,19 +19,3 @@
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
# context("All examples")
#
# # run all examples (will take forever)
# exported_functions <- ls("package:AMR")
#
# for (i in seq_len(length(exported_functions))) {
# test_that(paste(exported_functions[i], "works"), {
# skip_on_cran()
# expect_output(suppressWarnings(example(exported_functions[i],
# package = "AMR",
# give.lines = TRUE,
# run.dontrun = TRUE,
# run.donttest = TRUE)),
# label = paste0("Examples of function ", exported_functions[i]))
# })
# }

View File

@ -38,10 +38,10 @@ test_that("mic works", {
expect_warning(as.mic("INVALID VALUE"))
# print plots, should not raise errors
barplot(as.mic(c(1, 2, 4, 8)))
plot(as.mic(c(1, 2, 4, 8)))
print(as.mic(c(1, 2, 4, 8)))
# print plots
expect_success(x <- barplot(as.mic(c(1, 2, 4, 8))))
expect_success(x <- plot(as.mic(c(1, 2, 4, 8))))
expect_success(x <- print(as.mic(c(1, 2, 4, 8))))
expect_equal(summary(as.mic(c(2, 8))),
structure(c("Class" = "mic",

View File

@ -35,8 +35,8 @@ test_that("prediction of rsi works", {
expect_true(AMX_R[3] < AMX_R[20])
x <- resistance_predict(example_isolates, col_ab = "AMX", year_min = 2010, model = "binomial")
plot(x)
ggplot_rsi_predict(x)
expect_success(y <- plot(x))
expect_success(y <- ggplot_rsi_predict(x))
expect_error(ggplot_rsi_predict(example_isolates))
library(dplyr)

View File

@ -27,14 +27,14 @@ test_that("rsi works", {
expect_true(as.rsi("S") < as.rsi("I"))
expect_true(as.rsi("I") < as.rsi("R"))
expect_true(is.rsi(as.rsi("S")))
# print plots, should not raise errors
barplot(as.rsi(c("S", "I", "R")))
plot(as.rsi(c("S", "I", "R")))
print(as.rsi(c("S", "I", "R")))
expect_success(x <- barplot(as.rsi(c("S", "I", "R"))))
expect_success(x <- plot(as.rsi(c("S", "I", "R"))))
expect_success(x <- print(as.rsi(c("S", "I", "R"))))
expect_equal(as.character(as.rsi(c(1:3))), c("S", "I", "R"))
expect_equal(suppressWarnings(as.logical(as.rsi("INVALID VALUE"))), NA)
expect_equal(summary(as.rsi(c("S", "R"))),