quasiquotation for freq()

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2019-01-28 11:20:32 +01:00
1 parent 63e343d555
commit f6336fdd89
15 files changed
+550 -136

No files matched your search

+9 -9
View File
@@ -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")
+6
View File
@@ -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 %>%