diff --git a/DESCRIPTION b/DESCRIPTION index 70c1cfee..6db3b311 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: visR Title: Clinical Graphs and Tables Adhering to Graphical Principles -Version: 0.3.1 +Version: 0.3.1.9001 Authors@R: c( person("Mark", "Baillie", , "bailliem@gmail.com", role = c("aut", "cre", "cph")), person("Diego", "Saldana", , "diego.saldana@roche.com", role = "aut"), diff --git a/R/utils_table.R b/R/utils_table.R index 8ccda068..6614d5a7 100644 --- a/R/utils_table.R +++ b/R/utils_table.R @@ -43,9 +43,9 @@ summarize_long.numeric <- function(x) { dat <- list( mean = mean(x, na.rm = TRUE), min = min(x, na.rm = TRUE), - Q1 = quantile(x, probs = 0.25, na.rm = TRUE), + Q1 = quantile(x, probs = 0.25, na.rm = TRUE, names = FALSE), median = median(x, na.rm = TRUE), - Q3 = quantile(x, probs = 0.75, na.rm = TRUE), + Q3 = quantile(x, probs = 0.75, na.rm = TRUE, names = FALSE), max = max(x, na.rm = TRUE), sd = sd(x, na.rm = TRUE) ) diff --git a/tests/testthat/test-utils_table.R b/tests/testthat/test-utils_table.R index 98ecaee4..12f48a35 100644 --- a/tests/testthat/test-utils_table.R +++ b/tests/testthat/test-utils_table.R @@ -35,13 +35,19 @@ test_that("T1.3. Correct max value for numeric values", { test_that("T1.4. Correct Q1 value for numeric values", { values <- 1:5 summary <- visR::summarize_long(values) - testthat::expect_equal(summary[[1]]$Q1, stats::quantile(values)[2]) + testthat::expect_equal( + summary[[1]]$Q1, + stats::quantile(values, names = FALSE)[2] + ) }) test_that("T1.5. Correct Q3 value for numeric values", { values <- 1:5 summary <- visR::summarize_long(values) - testthat::expect_equal(summary[[1]]$Q3, stats::quantile(values)[4]) + testthat::expect_equal( + summary[[1]]$Q3, + stats::quantile(values, names = FALSE)[4] + ) }) test_that("T1.6. Correct SD value for numeric values", {