From 50807f0613a9bbc02916140429def7d0d1be8c92 Mon Sep 17 00:00:00 2001 From: Krystian Igras Date: Mon, 25 Jul 2022 11:51:38 +0000 Subject: [PATCH 1/3] Remove names from quantile in summarize_long. --- R/utils_table.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) ) From 5d448447f3a4be5cc3f0bda750ffc1d8dd446219 Mon Sep 17 00:00:00 2001 From: Krystian Igras Date: Mon, 25 Jul 2022 13:17:12 +0000 Subject: [PATCH 2/3] Bump apckage version. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ea215f7b..28cff7c6 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.0.9003 +Version: 0.3.0.9004 Authors@R: c( person("Mark", "Baillie", , "bailliem@gmail.com", role = c("aut", "cre", "cph")), person("Diego", "Saldana", , "diego.saldana@roche.com", role = "aut"), From 11f6b0ea47863b6e875f5cb88becc12ba2e4f8e5 Mon Sep 17 00:00:00 2001 From: Krystian Igras Date: Mon, 25 Jul 2022 13:23:12 +0000 Subject: [PATCH 3/3] Unit tests fixes. --- tests/testthat/test-utils_table.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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", {