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:
@ -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", {
|
||||
|
@ -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))
|
||||
|
||||
})
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user