From a27955adbb0c1010423103cc50c43c2e2a468209 Mon Sep 17 00:00:00 2001 From: Eero Date: Mon, 6 Jan 2020 22:57:20 +0100 Subject: [PATCH 1/3] Replace apostrophes grViz needs apostrophes to be in HTML. Escaping them won't work either, as they are replaced with " as part of the function. --- R/prisma.r | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/prisma.r b/R/prisma.r index 4c4e5c9..7d87c4e 100644 --- a/R/prisma.r +++ b/R/prisma.r @@ -145,6 +145,8 @@ prisma_graph <- function(found, if (full_text - full_text_exclusions != qualitative) warning("After full-text exclusions, a different number of remaining ", "articles for qualitative synthesis is stated.") + # apostrophes need to be replaced for grViz + labels <- lapply(labels, gsub, pattern = "'", replace = "’") dupes <- found + found_other - no_dupes labels_orig <- list( found = pnl("Records identified through", From 7d6df1d69ab58be296e01502bd181ef753f3402a Mon Sep 17 00:00:00 2001 From: Eero Date: Mon, 6 Jan 2020 23:00:39 +0100 Subject: [PATCH 2/3] Added an apostrohe test for labels --- tests/testthat/test-prisma.r | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/testthat/test-prisma.r b/tests/testthat/test-prisma.r index eba21bb..93f2237 100644 --- a/tests/testthat/test-prisma.r +++ b/tests/testthat/test-prisma.r @@ -90,6 +90,21 @@ test_that("change a label", { regexp = NA) }) +test_that("use an apostrophe in a label", { + expect_error( + prisma(found = 0, + found_other = 0, + no_dupes = 0, + screened = 0, + screen_exclusions = 0, + full_text = 0, + full_text_exclusions = 0, + qualitative = 0, + quantitative = 0, + labels = list(screened = "PLEASE DON'T RETURN AN ERROR")), + regexp = NA) +}) + test_that("numbers must work together", { expect_error(prisma(1, 2, 3, 4, 5, 6, 7, 8, 9)) expect_warning(prisma(1000, 20, 270, 270, 10, 260, 19, 240, 107)) From fca59db1379d12c9fb37de38be15a7efe259c1e7 Mon Sep 17 00:00:00 2001 From: Eero Date: Wed, 8 Apr 2020 12:22:40 +0200 Subject: [PATCH 3/3] Changed the description --- R/prisma.r | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/prisma.r b/R/prisma.r index 7d87c4e..c148540 100644 --- a/R/prisma.r +++ b/R/prisma.r @@ -1,7 +1,7 @@ #' Generate a PRISMA statement flow chart #' -#' Generate PRISMA statement flow chart for use in retrospective medical -#' research. Almost all arguments are mandatory, as they are in the recommended +#' Generate PRISMA statement flow chart for use in literature +#' research and reviews. Almost all arguments are mandatory, as they are in the recommended #' PRISMA statement. #' @param found Records found through database searching #' @param found_other Additional records identified through other sources