1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-18 10:43:16 +02:00

atc and bactid functions, readme update

This commit is contained in:
2018-08-25 22:01:14 +02:00
parent 460dee789f
commit 2acdb1981c
30 changed files with 761 additions and 449 deletions

22
tests/testthat/test-rsi.R Normal file
View File

@ -0,0 +1,22 @@
context("rsi.R")
test_that("rsi works", {
expect_true(as.rsi("S") < as.rsi("I"))
expect_true(as.rsi("I") < as.rsi("R"))
expect_true(as.rsi("R") > as.rsi("S"))
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_equal(suppressWarnings(as.logical(as.rsi("INVALID VALUE"))), NA)
expect_equal(summary(as.rsi(c("S", "R"))), c("Mode" = 'rsi',
"<NA>" = "0",
"Sum S" = "1",
"Sum IR" = "1",
"-Sum R" = "1",
"-Sum I" = "0"))
})