```{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 retrieveddata[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 columnother=FALSE, ## TRUE for right-hand columnfontsize=14,detail_databases=FALSE, ## TRUE if want to specify databasesdetail_registers=FALSE) ## TRUE if want to specify registers```
1
Only intended for .html output – otherwise specify caption and tag within markdown specification (e.g., {#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 retrieveddata[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 columnother=FALSE, ## TRUE for right-hand columnfontsize=14,detail_databases=FALSE, ## TRUE if want to specify databasesdetail_registers=FALSE) ## TRUE if want to specify registersPRISMA_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
{#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 retrieveddata[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 columnother=FALSE, ## TRUE for right-hand columnfontsize=14,detail_databases=FALSE, ## TRUE if want to specify databasesdetail_registers=FALSE) ## TRUE if want to specify registersPRISMA_save(plot, filename ="prisma.png", overwrite=TRUE) ## You will call out the plot OUTSIDE of the code chunk```
also
{#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).