R is for
Authoring!!

OOH Session #109…
Positron

Open Office Hours
(December 19, 2025)

  • Recap session #108
  • Today’s topic(s):
  • Shared problem-solving

Reminder – check it out!!

Fantastic resource!!

Recap of Session
#108:

PRISMA flow diagrams

```{r}
#| label: fig-prisma
#| fig-cap: "Look at the pretty pretty PRISMA"

library(PRISMA2020)

csvFile <- system.file("extdata", "PRISMA.csv", package = "PRISMA2020")

data <- read.csv(csvFile)

##################################################################################
## Identification: (new studies via databases and registers)

data[5,8] <- 1  ## databases (NA to exclude field)
data[7,8] <- 2  ## registers (NA to exclude field)
data[13,8] <- 3 ## duplicates (NA to exclude field)
data[14,8] <- 4 ## ineligible by automation (NA to exclude field)
data[15,8] <- 5 ## removed for other reasons (NA to exclude field)

## Optional details:
data[6,8] <- "PsychInfo, 100; GoogleScholar, 200"   ## set `detail_databases=TRUE` 
data[8,8] <- "PsychInfo, 300; GoogleScholar, 400"   ## set `detail_registers=TRUE` 

##################################################################################
####### Screening:

data[16,8] <- 6   ## records screened 
data[17,8] <- 7   ## records excluded 
data[18,8] <- 8   ## reports sought for retrieval 
data[19,8] <- 9   ## reports not retrieved
data[22,8] <- 10  ## reports assessed for eligibility

## Specification:
data[23,8] <- "stoopid, 500; boring, 600"  ## reports excluded

##################################################################################
####### Included:

data[26,8] <- 11  ## New studies included 
data[27,8] <- 12  ## Reports of new included studies

##################################################################################
##################################################################################
##################################################################################

prismadata <- PRISMA_data(data)

PRISMA_flowdiagram(prismadata, 
                           previous=FALSE,             ## TRUE for left-side column
                           other=FALSE,                ## TRUE for right-hand column
                           fontsize=14,
                           detail_databases=FALSE,     ## TRUE if want to specify databases
                           detail_registers=FALSE)     ## TRUE if want to specify registers
```
1
Only intended for .html output – otherwise specify caption and tag within markdown specification (e.g., ![Look at the pretty pretty PRISMA](image){#fig-prisma})
2
Self–contained data grab from within package – no need to access template from other (external) locations
3
These specifications will complete the primary PRISMA info – you will need to expand if you wish to include “previous” or “other” diagram arms
```{r}
library(PRISMA2020)

csvFile <- system.file("extdata", "PRISMA.csv", package = "PRISMA2020")

data <- read.csv(csvFile)

##################################################################################
## Identification: (new studies via databases and registers)

data[5,8] <- 1  ## databases (NA to exclude field)
data[7,8] <- 2  ## registers (NA to exclude field)
data[13,8] <- 3 ## duplicates (NA to exclude field)
data[14,8] <- 4 ## ineligible by automation (NA to exclude field)
data[15,8] <- 5 ## removed for other reasons (NA to exclude field)

## Optional details:
data[6,8] <- "PsychInfo, 100; GoogleScholar, 200"   ## set `detail_databases=TRUE` 
data[8,8] <- "PsychInfo, 300; GoogleScholar, 400"   ## set `detail_registers=TRUE` 

##################################################################################
####### Screening:

data[16,8] <- 6   ## records screened 
data[17,8] <- 7   ## records excluded 
data[18,8] <- 8   ## reports sought for retrieval 
data[19,8] <- 9   ## reports not retrieved
data[22,8] <- 10  ## reports assessed for eligibility

## Specification:
data[23,8] <- "stoopid, 500; boring, 600"  ## reports excluded

##################################################################################
####### Included:

data[26,8] <- 11  ## New studies included 
data[27,8] <- 12  ## Reports of new included studies

##################################################################################
##################################################################################
##################################################################################

prismadata <- PRISMA_data(data)

plot <- PRISMA_flowdiagram(prismadata, 
                           previous=FALSE,             ## TRUE for left-side column
                           other=FALSE,                ## TRUE for right-hand column
                           fontsize=14,
                           detail_databases=FALSE,     ## TRUE if want to specify databases
                           detail_registers=FALSE)     ## TRUE if want to specify registers

PRISMA_save(plot, filename = "prisma.svg", overwrite=TRUE)

## You will call out the plot OUTSIDE of the code chunk
```
1
overwrite argument seems finicky – may have to keep an eye on output messages

also works with

![caption](image){#fig-label}

```{r}
library(PRISMA2020)

csvFile <- system.file("extdata", "PRISMA.csv", package = "PRISMA2020")

data <- read.csv(csvFile)

##################################################################################
## Identification: (new studies via databases and registers)

data[5,8] <- 1  ## databases (NA to exclude field)
data[7,8] <- 2  ## registers (NA to exclude field)
data[13,8] <- 3 ## duplicates (NA to exclude field)
data[14,8] <- 4 ## ineligible by automation (NA to exclude field)
data[15,8] <- 5 ## removed for other reasons (NA to exclude field)

## Optional details:
data[6,8] <- "PsychInfo, 100; GoogleScholar, 200"   ## set `detail_databases=TRUE` 
data[8,8] <- "PsychInfo, 300; GoogleScholar, 400"   ## set `detail_registers=TRUE` 

##################################################################################
####### Screening:

data[16,8] <- 6   ## records screened 
data[17,8] <- 7   ## records excluded 
data[18,8] <- 8   ## reports sought for retrieval 
data[19,8] <- 9   ## reports not retrieved
data[22,8] <- 10  ## reports assessed for eligibility

## Specification:
data[23,8] <- "stoopid, 500; boring, 600"  ## reports excluded

##################################################################################
####### Included:

data[26,8] <- 11  ## New studies included 
data[27,8] <- 12  ## Reports of new included studies

##################################################################################
##################################################################################
##################################################################################

prismadata <- PRISMA_data(data)

plot <- PRISMA_flowdiagram(prismadata, 
                           previous=FALSE,             ## TRUE for left-side column
                           other=FALSE,                ## TRUE for right-hand column
                           fontsize=14,
                           detail_databases=FALSE,     ## TRUE if want to specify databases
                           detail_registers=FALSE)     ## TRUE if want to specify registers

PRISMA_save(plot, filename = "prisma.png", overwrite=TRUE)  

## You will call out the plot OUTSIDE of the code chunk
```

also

![caption](image){#fig-label}

Note

The .svg image file type requires additional support to be rendered within a Quarto . rsvg-convert should work, but simply accepting an alternative image file type is another work–around (that’s what is done in the adjacent code chunk at line #52).

Today…

Positron

Tutorial1

Session Info (December 19, 2025) Rendering:

R version 4.5.0 (2025-04-11 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)

Matrix products: default
  LAPACK version 3.12.1

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/Chicago
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.5.0    fastmap_1.2.0     cli_3.6.5         tools_4.5.0      
 [5] htmltools_0.5.8.1 rstudioapi_0.17.1 yaml_2.3.10       rmarkdown_2.29   
 [9] knitr_1.50        jsonlite_2.0.0    xfun_0.52         digest_0.6.37    
[13] rlang_1.1.6       evaluate_1.0.5