1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 20:21:55 +02:00

addins and small improvements to microorganisms dataset

This commit is contained in:
2018-07-04 17:20:03 +02:00
parent 10fce8382c
commit 34ee0247ac
18 changed files with 284 additions and 58 deletions

View File

@ -20,11 +20,10 @@ test_that("G-test works", {
# INDEPENDENCE
# this should always yield a p value of around 0
x <- matrix(data = round(runif(4) * 100000, 0),
ncol = 2,
byrow = TRUE)
expect_lt(g.test(x),
0.0001)
1)
})

View File

@ -0,0 +1,10 @@
context("like.R")
test_that("`like` works", {
expect_true(suppressWarnings("test" %like% c("^t", "^s")))
expect_true("test" %like% "test")
expect_true("test" %like% "TEST")
expect_true(as.factor("test") %like% "TEST")
expect_identical(factor(c("Test case", "Something different", "Yet another thing")) %like% c("case", "diff", "yet"),
c(TRUE, TRUE, TRUE))
})

View File

@ -1,12 +1,5 @@
context("misc.R")
test_that("`like` works", {
expect_true(suppressWarnings("test" %like% c("^t", "^s")))
expect_true("test" %like% "test")
expect_true("test" %like% "TEST")
expect_true(as.factor("test") %like% "TEST")
})
test_that("percentages works", {
expect_equal(percent(0.25), "25%")
expect_equal(percent(0.5), "50%")

View File

@ -1,6 +1,6 @@
context("p.symbol.R")
test_that("P symbol works", {
expect_identical(p.symbol(c(0.001, 0.01, 0.05, 0.1, 1)),
c("***", "**", "*", ".", " "))
expect_identical(p.symbol(c(0.001, 0.01, 0.05, 0.1, 1, NA, 3)),
c("***", "**", "*", ".", " ", NA, NA))
})