mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 04:42:22 +02:00
addins and small improvements to microorganisms dataset
This commit is contained in:
@ -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)
|
||||
|
||||
})
|
||||
|
10
tests/testthat/test-like.R
Normal file
10
tests/testthat/test-like.R
Normal 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))
|
||||
})
|
@ -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%")
|
||||
|
@ -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))
|
||||
})
|
||||
|
Reference in New Issue
Block a user