mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 20:41:58 +02:00
quasiquotation for freq()
This commit is contained in:
@ -21,15 +21,15 @@
|
||||
|
||||
context("atc.R")
|
||||
|
||||
test_that("guess_atc works", {
|
||||
expect_equal(as.character(guess_atc(c("J01FA01",
|
||||
"Erythromycin",
|
||||
"eryt",
|
||||
"ERYT",
|
||||
"ERY",
|
||||
"Erythrocin",
|
||||
"Eryzole",
|
||||
"Pediamycin"))),
|
||||
test_that("as.atc works", {
|
||||
expect_equal(suppressWarnings(as.character(guess_atc(c("J01FA01",
|
||||
"Erythromycin",
|
||||
"eryt",
|
||||
"ERYT",
|
||||
"ERY",
|
||||
"Erythrocin",
|
||||
"Eryzole",
|
||||
"Pediamycin")))),
|
||||
rep("J01FA01", 8))
|
||||
|
||||
expect_identical(class(as.atc("amox")), "atc")
|
||||
|
@ -92,6 +92,12 @@ test_that("frequency table works", {
|
||||
expect_output(print(septic_patients %>% group_by(gender) %>% freq(amox, quote = TRUE)))
|
||||
expect_output(print(septic_patients %>% group_by(gender) %>% freq(amox, markdown = TRUE)))
|
||||
|
||||
# quasiquotation
|
||||
expect_output(print(septic_patients %>% freq(mo_genus(mo))))
|
||||
expect_output(print(septic_patients %>% freq(mo, mo_genus(mo))))
|
||||
expect_output(print(septic_patients %>% group_by(gender) %>% freq(mo_genus(mo))))
|
||||
expect_output(print(septic_patients %>% group_by(gender) %>% freq(mo, mo_genus(mo))))
|
||||
|
||||
# top 5
|
||||
expect_equal(
|
||||
septic_patients %>%
|
||||
|
Reference in New Issue
Block a user