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

support A. species for as.mo, cleanup

This commit is contained in:
2018-11-24 20:25:09 +01:00
parent 63ba4b2980
commit 9ddf6dc530
14 changed files with 126 additions and 93 deletions

View File

@ -5,6 +5,9 @@ test_that("percentages works", {
expect_equal(percent(0.5), "50%")
expect_equal(percent(0.500, force_zero = TRUE), "50.0%")
expect_equal(percent(0.1234), "12.3%")
# round up 0.5
expect_equal(percent(0.0054), "0.5%")
expect_equal(percent(0.0055), "0.6%")
})
test_that("size format works", {

View File

@ -195,6 +195,11 @@ test_that("as.mo works", {
# TSN of prevalent and non prevalent ones
expect_equal(mo_TSN(c("Gomphosphaeria aponina delicatula", "Escherichia coli")),
c(717, 285))
c(717, 285))
expect_equal(mo_fullname(c("E. spp.",
"E. spp",
"E. species")),
rep("Escherichia species", 3))
})

View File

@ -18,7 +18,7 @@ test_that("read 4D works", {
tf <- tempfile()
write.table(test1, file = tf, quote = F, sep = "\t")
x <- read.4D(tf, skip = 0)
x <- read.4D(tf, skip = 0, info = TRUE)
unlink(tf)
expect_equal(ncol(x), 11)