├── .Rbuildignore ├── .github ├── .gitignore ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── propose_tool.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── R-CMD-check.yaml │ ├── pkgdown.yaml │ ├── render-readme_pkgdown.yml │ └── test-coverage.yaml ├── .gitignore ├── .mergify.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CRAN-RELEASE ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── NEWS.md ├── R ├── exampledataprep.R ├── helpers-metafor.R ├── helpers.R ├── rob_data.R ├── rob_direction.R ├── rob_dummy.R ├── rob_forest.R ├── rob_save.R ├── rob_summary.R ├── rob_tools.R ├── rob_traffic_light.R ├── robvis.R └── utils-pipe.R ├── README.Rmd ├── README.md ├── RSM-paper ├── ama.csl ├── manuscript versions │ ├── manuscript V1.docx │ ├── manuscript V2.docx │ ├── manuscript V3.docx │ ├── manuscript V4.docx │ ├── manuscript v11 JPTH.docx │ ├── manuscript v11.docx │ ├── manuscript v12.docx │ ├── manuscript v13.docx │ ├── manuscript v5.docx │ ├── manuscript v6.docx │ ├── manuscript v7.docx │ ├── manuscript v8.docx │ ├── robvis manuscript - RSM Revision Submitted.docx │ └── robvis manuscript - RSM Submitted.docx ├── manuscript.Rmd ├── references.bib ├── reviewer-comments │ ├── robvis_reviewer_comments v2.docx │ └── robvis_reviewer_comments.docx ├── submitted │ ├── Cover letter.docx │ ├── RSM robvis Manuscript - Submitted Version - Initial.pdf │ └── RSM robvis manuscript - Submitted Version - Revision.pdf └── word-styles-reference-01.docx ├── _pkgdown.yml ├── codecov.yml ├── data ├── data_bias_direction.rda ├── data_quadas.rda ├── data_quips.rda ├── data_rob1.rda ├── data_rob2.rda ├── data_rob2_cluster.rda ├── data_robins_e.rda └── data_robins_i.rda ├── data_raw ├── bias_direction.csv ├── data_quadas.csv ├── data_quips.csv ├── data_rob1.csv ├── data_rob2.csv ├── data_rob2_cluster.csv ├── data_robins_e.csv └── data_robins_i.csv ├── inst ├── CITATION └── WORDLIST ├── man ├── data_bias_direction.Rd ├── data_quadas.Rd ├── data_quips.Rd ├── data_rob1.Rd ├── data_rob2.Rd ├── data_rob2_cluster.Rd ├── data_robins_e.Rd ├── data_robins_i.Rd ├── figures │ ├── rob_forest.png │ ├── robplot1.png │ ├── robplot2.png │ ├── robplot3.png │ ├── robplot4.png │ ├── robplot5.png │ ├── robplot6.png │ ├── robplot7.png │ └── robvis_hex_box.png ├── pipe.Rd ├── rob_append_weights.Rd ├── rob_direction.Rd ├── rob_dummy.Rd ├── rob_forest.Rd ├── rob_save.Rd ├── rob_summary.Rd ├── rob_tools.Rd ├── rob_traffic_light.Rd └── robvis.Rd ├── robvis.Rproj ├── tests ├── spelling.R ├── testthat.R └── testthat │ ├── Rplots.pdf │ ├── _snaps │ ├── forest │ │ ├── paired_rob2.png │ │ ├── paired_rob2_complex.png │ │ ├── paired_robinse.png │ │ ├── paired_robinsi.png │ │ └── paired_robinsi_complex.png │ ├── rob_paired_direction │ │ └── paried_basic.png │ ├── rob_summary │ │ ├── QUADAS - Basic.png │ │ ├── QUADAS - Colour - cochrane.png │ │ ├── QUADAS - Colour - colourblind.png │ │ ├── QUADAS - Colour - custom.png │ │ ├── QUADAS - Overall.png │ │ ├── QUIPS - Basic.png │ │ ├── QUIPS - Colour - cochrane.png │ │ ├── QUIPS - Colour - colourblind.png │ │ ├── QUIPS - Colour - custom.png │ │ ├── QUIPS - Overall.png │ │ ├── ROB1 - Basic.png │ │ ├── ROB1 - Colour - cochrane.png │ │ ├── ROB1 - Colour - colourblind.png │ │ ├── ROB1 - Colour - custom.png │ │ ├── ROB1 - Judgement Labels.png │ │ ├── ROB1 - Overall.png │ │ ├── ROB1 - ROBINS-I Judgement Labels.png │ │ ├── ROB2 - Basic.png │ │ ├── ROB2 - Colour - cochrane.png │ │ ├── ROB2 - Colour - colourblind.png │ │ ├── ROB2 - Colour - custom.png │ │ ├── ROB2 - Overall.png │ │ ├── ROBINS-E - Basic.png │ │ ├── ROBINS-E - Colour - cochrane.png │ │ ├── ROBINS-E - Colour - colourblind.png │ │ ├── ROBINS-E - Colour - custom.png │ │ ├── ROBINS-E - Overall.png │ │ ├── ROBINS-I - Basic.png │ │ ├── ROBINS-I - Colour - cochrane.png │ │ ├── ROBINS-I - Colour - colourblind.png │ │ ├── ROBINS-I - Colour - custom.png │ │ └── ROBINS-I - Overall.png │ └── rob_traffic_light │ │ ├── TF - QUADAS - Basic.png │ │ ├── TF - QUADAS - Colour - cochrane.png │ │ ├── TF - QUADAS - Colour - colourblind.png │ │ ├── TF - QUADAS - Colour - custom.png │ │ ├── TF - QUADAS - Overall.png │ │ ├── TF - QUADAS - Point size.png │ │ ├── TF - QUIPS - Basic.png │ │ ├── TF - QUIPS - Colour - cochrane.png │ │ ├── TF - QUIPS - Colour - colourblind.png │ │ ├── TF - QUIPS - Colour - custom.png │ │ ├── TF - QUIPS - Overall.png │ │ ├── TF - QUIPS - Point Size.png │ │ ├── TF - ROB2 - Basic.png │ │ ├── TF - ROB2 - Colour - cochrane.png │ │ ├── TF - ROB2 - Colour - colourblind.png │ │ ├── TF - ROB2 - Colour - custom.png │ │ ├── TF - ROB2 - Overall.png │ │ ├── TF - ROB2 - Point Size.png │ │ ├── TF - ROB2C - Basic.png │ │ ├── TF - ROB2C - Colour - cochrane.png │ │ ├── TF - ROB2C - Colour - colourblind.png │ │ ├── TF - ROB2C - Colour - custom.png │ │ ├── TF - ROB2C - Overall.png │ │ ├── TF - ROB2C - Point Size.png │ │ ├── TF - ROBG - Basic.png │ │ ├── TF - ROBG - Domain Labels.png │ │ ├── TF - ROBG - Judgement labels.png │ │ ├── TF - ROBG - Judgement title.png │ │ ├── TF - ROBG - Label x axis.png │ │ ├── TF - ROBG - Label y axis.png │ │ ├── TF - ROBG - Overall domain.png │ │ ├── TF - ROBG - Overall.png │ │ ├── TF - ROBG - Point size.png │ │ ├── TF - ROBINS-E - Basic.png │ │ ├── TF - ROBINS-E - Colour - cochrane.png │ │ ├── TF - ROBINS-E - Colour - colourblind.png │ │ ├── TF - ROBINS-E - Colour - custom.png │ │ ├── TF - ROBINS-E - Overall.png │ │ ├── TF - ROBINS-E - Point Size.png │ │ ├── TF - ROBINS-I - Basic.png │ │ ├── TF - ROBINS-I - Colour - cochrane.png │ │ ├── TF - ROBINS-I - Colour - colourblind.png │ │ ├── TF - ROBINS-I - Colour - custom.png │ │ ├── TF - ROBINS-I - Overall.png │ │ └── TF - ROBINS-I - Point Size.png │ ├── test-rob_paired_direction.R │ ├── test_datasets.R │ ├── test_errors.R │ ├── test_forest.R │ ├── test_helpers.R │ ├── test_rob_append_weights.R │ ├── test_rob_save.R │ ├── test_rob_summary.R │ ├── test_rob_tools.R │ └── test_rob_traffic_light.R └── vignettes ├── Introduction_to_robvis.R ├── Introduction_to_robvis.Rmd ├── Introduction_to_robvis.html └── articles ├── metafor.R ├── metafor.Rmd └── metafor.html /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^revdep$ 2 | ^cran-comments\.md$ 3 | ^README\.Rmd$ 4 | ^\.travis\.yml$ 5 | ^Meta$ 6 | ^doc$ 7 | ^data_raw$ 8 | ^R/exampledataprep\.R$ 9 | ^robvis\.Rproj$ 10 | ^\.Rproj\.user$ 11 | ^\.github$ 12 | ^appveyor\.yml$ 13 | ^codecov\.yml$ 14 | ^.mergify\.yml$ 15 | ^CODE_OF_CONDUCT\.md$ 16 | ^CONTRIBUTING\.md$ 17 | ^JOSS-paper$ 18 | ^RSM-paper$ 19 | R/rob_blobbogram.R 20 | cran-comments.md 21 | ^CRAN-RELEASE$ 22 | ^_pkgdown\.yml$ 23 | ^docs$ 24 | ^pkgdown$ 25 | \.png 26 | .jpeg 27 | .xlsx 28 | .pdf 29 | .tiff 30 | 31 | 32 | ^vignettes/articles$ 33 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: mcguinlu 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: mcguinlu 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/propose_tool.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Propose a new tool template 3 | about: Please complete this to suggest a new risk-of-bias assessment tool template for robvis 4 | title: '' 5 | labels: enhancement 6 | assignees: mcguinlu 7 | --- 8 | 9 | Please complete all of the sections below to propose a new tool template. 10 | 11 | **Where is this tool published?** 12 | 13 | 14 | **Are you the primary author/maintainer of this tool?** 15 | 16 | 17 | **How many domains does this tool have?** 18 | 19 | 20 | **Does the tool require an overall risk-of-bias column?** 21 | 22 | **What are the domain headings/titles for this tool?** 23 | 30 | 31 | **What are the judgement labels for this tool?** 32 | 33 | 34 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## **PR Checklist** 2 | ### All Submissions: 3 | 4 | * [ ] Have you followed the guidelines in our [Contributing](../CONTRIBUTING.md) document? 5 | * [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/mcguinlu/robvis/pulls) for the same update/change? 6 | * [ ] Does your submission pass **R CMD check** locally? 7 | * [ ] Have you sufficiently **documented** the new functionality? 8 | * [ ] Have you added **tests** for any new functionality this PR introduces? 9 | 10 | 11 | 12 | ## **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) 13 | 14 | 15 | 16 | ## **What is the current behavior?** (You can also link to an open issue here) 17 | 18 | 19 | 20 | ## **What is the new behavior (if this is a feature change)?** 21 | 22 | 23 | 24 | ## **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) 25 | 26 | 27 | ## **Other relevant information**: 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: R-CMD-check 10 | 11 | jobs: 12 | R-CMD-check: 13 | runs-on: ${{ matrix.config.os }} 14 | 15 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) 16 | 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | config: 21 | - {os: macos-latest, r: 'release'} 22 | - {os: windows-latest, r: 'release'} 23 | - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} 24 | - {os: ubuntu-latest, r: 'release'} 25 | - {os: ubuntu-latest, r: 'oldrel-1'} 26 | 27 | env: 28 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 29 | R_KEEP_PKG_SOURCE: yes 30 | 31 | steps: 32 | - uses: actions/checkout@v3 33 | 34 | - uses: r-lib/actions/setup-pandoc@v2 35 | 36 | - uses: r-lib/actions/setup-r@v2 37 | with: 38 | r-version: ${{ matrix.config.r }} 39 | http-user-agent: ${{ matrix.config.http-user-agent }} 40 | use-public-rspm: true 41 | 42 | - uses: r-lib/actions/setup-r-dependencies@v2 43 | with: 44 | extra-packages: any::rcmdcheck 45 | needs: check 46 | 47 | - uses: r-lib/actions/check-r-package@v2 48 | with: 49 | upload-snapshots: true 50 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | name: pkgdown 13 | 14 | jobs: 15 | pkgdown: 16 | runs-on: ubuntu-latest 17 | # Only restrict concurrency for non-PR jobs 18 | concurrency: 19 | group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} 20 | env: 21 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 22 | permissions: 23 | contents: write 24 | steps: 25 | - uses: actions/checkout@v3 26 | 27 | - uses: r-lib/actions/setup-pandoc@v2 28 | 29 | - uses: r-lib/actions/setup-r@v2 30 | with: 31 | use-public-rspm: true 32 | 33 | - uses: r-lib/actions/setup-r-dependencies@v2 34 | with: 35 | extra-packages: any::pkgdown, local::. 36 | needs: website 37 | 38 | - name: Build site 39 | run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) 40 | shell: Rscript {0} 41 | 42 | - name: Deploy to GitHub pages 🚀 43 | if: github.event_name != 'pull_request' 44 | uses: JamesIves/github-pages-deploy-action@v4.4.1 45 | with: 46 | clean: false 47 | branch: gh-pages 48 | folder: docs 49 | -------------------------------------------------------------------------------- /.github/workflows/render-readme_pkgdown.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - master 5 | - main 6 | 7 | name: Render README 8 | 9 | jobs: 10 | render: 11 | name: Render README 12 | runs-on: macOS-latest 13 | env: 14 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 15 | steps: 16 | - uses: actions/checkout@v2 17 | - uses: r-lib/actions/setup-r@v1 18 | - uses: r-lib/actions/setup-pandoc@v1 19 | - name: Install rmarkdown, remotes, and the local package 20 | run: | 21 | install.packages("remotes") 22 | remotes::install_local(".") 23 | remotes::install_cran(c("rmarkdown","kableExtra","magrittr")) 24 | shell: Rscript {0} 25 | - name: Render README 26 | run: Rscript -e 'rmarkdown::render("README.Rmd")' 27 | - name: Commit results 28 | run: | 29 | git config --local user.email "actions@github.com" 30 | git config --local user.name "GitHub Actions" 31 | git add -f README.md man/figures/robplot* 32 | git commit -m "Re-build README.md" || echo "No changes to commit" 33 | git push origin master || echo "No changes to commit" 34 | 35 | -------------------------------------------------------------------------------- /.github/workflows/test-coverage.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | name: test-coverage 4 | 5 | jobs: 6 | test-coverage: 7 | runs-on: macos-latest 8 | env: 9 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 10 | 11 | steps: 12 | - uses: actions/checkout@v3 13 | 14 | - uses: r-lib/actions/setup-r@v2 15 | with: 16 | r-version: 'release' 17 | 18 | - uses: r-lib/actions/setup-pandoc@v2 19 | 20 | - name: Query dependencies 21 | run: | 22 | install.packages('remotes') 23 | saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) 24 | writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") 25 | shell: Rscript {0} 26 | 27 | - name: Cache R packages 28 | if: runner.os != 'Windows' 29 | uses: actions/cache@v1 30 | with: 31 | path: ${{ env.R_LIBS_USER }} 32 | key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} 33 | restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- 34 | 35 | - name: Install dependencies 36 | run: | 37 | remotes::install_deps(dependencies = TRUE) 38 | remotes::install_cran("covr") 39 | shell: Rscript {0} 40 | 41 | - name: Test coverage 42 | run: covr::codecov(quiet = FALSE, clean = FALSE) 43 | shell: Rscript {0} 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Meta 2 | doc 3 | .Rhistory 4 | .RData 5 | .Rproj.user 6 | cran-comments.md 7 | RSM-paper/figs/* 8 | inst/doc 9 | docs/ 10 | *.jpeg 11 | /*.png 12 | *.xlsx 13 | R/rob_paired_plot.R 14 | -------------------------------------------------------------------------------- /.mergify.yml: -------------------------------------------------------------------------------- 1 | pull_request_rules: 2 | - name: automatic merge and delete on CI success 3 | conditions: 4 | - status-success=continuous-integration/travis-ci/pr 5 | - status-success=continuous-integration/travis-ci/push 6 | - status-success=continuous-integration/appveyor/pr 7 | - status-success=continuous-integration/appveyor/branch 8 | - label=merge when passing 9 | - label=small fix 10 | actions: 11 | merge: 12 | method: merge 13 | delete_head_branch: {} 14 | 15 | 16 | - name: automatic merge and keep on CI success 17 | conditions: 18 | - status-success=continuous-integration/travis-ci/pr 19 | - status-success=continuous-integration/travis-ci/push 20 | - status-success=continuous-integration/appveyor/pr 21 | - status-success=continuous-integration/appveyor/branch 22 | - label=merge when passing 23 | actions: 24 | merge: 25 | method: merge 26 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, we pledge to respect all people who 4 | contribute through reporting issues, posting feature requests, updating documentation, 5 | submitting pull requests or patches, and other activities. 6 | 7 | We are committed to making participation in this project a harassment-free experience for 8 | everyone, regardless of level of experience, gender, gender identity and expression, 9 | sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. 10 | 11 | Examples of unacceptable behavior by participants include the use of sexual language or 12 | imagery, derogatory comments or personal attacks, trolling, public or private harassment, 13 | insults, or other unprofessional conduct. 14 | 15 | Project maintainers have the right and responsibility to remove, edit, or reject comments, 16 | commits, code, wiki edits, issues, and other contributions that are not aligned to this 17 | Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed 18 | from the project team. 19 | 20 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by 21 | opening an issue or emailing the project lead, Luke McGuinness (). 22 | 23 | This Code of Conduct is adapted from the Contributor Covenant 24 | (http://contributor-covenant.org), version 1.0.0, available at 25 | http://contributor-covenant.org/version/1/0/0/ 26 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to robvis 2 | 3 | The goal of this guide is to help contribute to robvis as quickly as possible. 4 | 5 | Please note that robvis is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms. 6 | 7 | 8 | ### Fixing typos 9 | Small typos or grammatical errors in documentation may be edited directly using the GitHub web interface of your forked repository, so long as the changes are made in the _source_ file. 10 | 11 | * DO: edit a roxygen comment in a `.R` file below `R/`. 12 | * DO NOT: edit an `.Rd` file below `man/`. 13 | 14 | Similarly, typos/errors in the supporting documents (e.g. these contributing guidelines, NEWS.md, CODE_OF_CONDUCT.md) may be edited directly using the GitHub web interface of your forked repository. 15 | 16 | The exception to the above is when typos/errors occur in the README.md document. To correct these: 17 | 18 | * Fork the respository to your personal GitHub account 19 | * Edit the README.Rmd document to fix the error 20 | * Knit the README.Rmd document to produce the corrected README.md 21 | * Commit changes and push both corrected documents to your forked respository 22 | * Issue a pull request (see the section on [Pull Requests](#pull-requests), below). 23 | 24 | 25 | ### Filing an issue 26 | 27 | When filing an issue, the most important thing is to include a minimal 28 | reproducible example so that we can quickly verify the problem, and then figure 29 | out how to fix it. See "[Writing a good reproducible example](https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html)". 30 | 31 | 32 | 1. **Any additional required packages** should be loaded at the top of the script, so it's easy to 33 | see which ones the example needs. 34 | 35 | 2. Spend a little bit of time ensuring that your **code** is easy for others to 36 | read: 37 | 38 | * make sure you've used spaces and your variable names are concise, but 39 | informative 40 | 41 | * use comments generously to indicate where your problem lies 42 | 43 | * do your best to remove everything that is not related to the problem. 44 | 45 | You can check you have actually made a reproducible example by starting up a 46 | fresh R session and pasting your script in. 47 | 48 | 49 | ### Pull Requests 50 | 51 | #### Getting Started 52 | * Make sure you have a [GitHub account](https://github.com/signup/free). 53 | * Familiarise yourself with Git and Github, using the [resources](#additional-resources) at the end of this page. 54 | 55 | #### Prerequisites 56 | Before you make a substantial pull request, you should always file an issue and 57 | make sure someone from the team agrees that it’s a problem. If you’ve found a 58 | bug, create an associated issue and illustrate the bug with a minimal 59 | [reproducible example](https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html). 60 | 61 | #### Pull request process 62 | * We recommend that you create a Git branch for each pull request (PR). 63 | * We use [roxygen2](https://cran.r-project.org/package=roxygen2), with 64 | [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/markdown.html), 65 | for documentation. 66 | * For user-facing changes, add a bullet to the top of [NEWS.md](NEWS.md) below the current 67 | development version header describing the changes made followed by your GitHub 68 | username, and links to relevant issue(s)/PR(s). 69 | 70 | ### Additional Resources 71 | 72 | * The [Git and Github](http://r-pkgs.had.co.nz/git.html) section of the __R Packages__ book by Hadley Wickham 73 | * [Happy Git and GitHub for the useR](https://happygitwithr.com/) 74 | * General GitHub [documentation](https://help.github.com/) 75 | * GitHub pull request [documentation]](https://help.github.com/articles/creating-a-pull-request/) 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /CRAN-RELEASE: -------------------------------------------------------------------------------- 1 | This package was submitted to CRAN on 2019-10-24. 2 | Once it is accepted, delete this file and tag the release (commit 4c335af37c). 3 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: robvis 2 | Title: Visualize the Results of Risk-of-Bias (ROB) Assessments 3 | Version: 0.3.0.900 4 | Authors@R: c( 5 | person("Luke", "McGuinness", 6 | role = c("aut", "cre"), 7 | email = "luke.mcguinness@bristol.ac.uk"), 8 | person("Emily", "Kothe", role = "ctb"), 9 | person("Alex", "Fowler", rol = "ctb"), 10 | person("Randall", "Boyes", rol = "ctb"), 11 | person("Wolfgang","Viechtbauer",rol="ctb")) 12 | Description: Helps users in quickly visualizing risk-of-bias 13 | assessments performed as part of a systematic review. It allows users to 14 | create weighted bar-plots of the distribution of risk-of-bias judgments 15 | within each bias domain, in addition to traffic-light plots of the 16 | specific domain-level judgments for each study. The resulting figures are 17 | of publication quality and are formatted according the risk-of-bias 18 | assessment tool use to perform the assessments. Currently, the supported 19 | tools are ROB2.0 (for randomized controlled trials; Sterne et al (2019) 20 | ), ROBINS-I (for non-randomised studies of 21 | interventions; Sterne (2016) ), and Quality & 22 | Applicability of Diagnostic Accuracy Studies V2 (Whiting et al (2011) 23 | ), and QUIPS (Hayden et al 24 | (2013) . 25 | License: MIT + file LICENSE 26 | Encoding: UTF-8 27 | LazyData: true 28 | RoxygenNote: 7.2.3 29 | Depends: 30 | R (>= 3.6) 31 | Imports: 32 | ggplot2 (>= 3.3.0), 33 | tidyr (>= 1.0.0), 34 | scales (>= 1.1.0), 35 | metafor (>= 2.4), 36 | dplyr (>= 1.0.2), 37 | stringr (>= 1.4.0), 38 | grDevices, 39 | magrittr, 40 | purrr 41 | Suggests: 42 | metadat, 43 | knitr (>= 1.28), 44 | rmarkdown (>= 2.3), 45 | covr (>= 3.5.1), 46 | testthat (>= 2.3.0), 47 | triangulate (>= 0.0.1), 48 | spelling (>= 2.2) 49 | VignetteBuilder: 50 | knitr, 51 | rmarkdown 52 | Config/testthat/edition: 3 53 | BugReports: https://github.com/mcguinlu/robvis 54 | URL: https://github.com/mcguinlu/robvis 55 | Language: en-US 56 | Remotes: 57 | mcguinlu/triangulate 58 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2019 2 | COPYRIGHT HOLDER: Luke A McGuinness 3 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export("%>%") 4 | export(rob_append_weights) 5 | export(rob_dummy) 6 | export(rob_forest) 7 | export(rob_save) 8 | export(rob_summary) 9 | export(rob_tools) 10 | export(rob_traffic_light) 11 | importFrom(magrittr,"%>%") 12 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # robvis 0.3.0.900 (Development) 2 | 3 | As part of a major overhaul of the code in order to improve maintainability and user-friendliness, there have been a number of significant changes made in this version. 4 | 5 | * Breaking changes 6 | * There are now stricter conditions placed on the data provided to robvis based on the options specified, which also address some niche cases which were causing bugs. Informative messages are provided to users if the data is not compatible with their chosen options. **Existing code may have to be updated - I am sorry for this, but this should make it easier to support long-term stability of the API** 7 | * The default point size for `rob_traffic_light()` has been changed from 20 to 10. This is because, following a review of published `robvis` plots, users are not changing the defaults very often and in almost all cases, a smaller default looks better. **While existing code will continue to work, the resulting plots will look different unless the `psize` argument was explicitly defined.** 8 | * A new logical argument, `overall`, which allows users to specify whether to include an "Overall" column in the traffic light plot, has been added to `rob_traffic_light()` (default is TRUE). In order to have consistent behaviour across the two main functions, the default of the `overall` argument in`rob_summary()` has been changed from `FALSE` to `TRUE` [I admit that I'm not sure why I set it to FALSE in the first place]. **While existing code will continue to work, the resulting plots will look different unless the `overall` argument was explicitly defined.** 9 | * The default the `weighted` argument for `rob_summary()` has been changed from `TRUE` to `FALSE`, both to ensure better consistency across the two main functions (`rob_traffic_light()` does not require a "Weight" variable) and to reduce a hurdle to usage among new users. **While existing code will continue to work, the resulting plots will look different unless the `weighted` argument was explicitly defined.** 10 | * The example datasets in the package now no longer include a weight column. This is to make using weights to produce a weighted barplot a specialised endeavour rather than the default behaviour for the package. This maps to the change to `weighted = FALSE` as the default for `rob_summary()`. 11 | * The `overall` argument in the "Generic" now acts slightly differently both to previous versions of the function and to the other templates. Rather than removing an additional column from the dataset if `overall = FALSE`, which doesn't make sense if their data doesn't contain an overall column, it simply highlights the last column (in `rob_traffic_light()`) or bolds the last heading (in `rob_summary()`). 12 | * In order to make the "Generic" template for `rob_summary()` compatible with tools that have 4 levels of judgement (e.g. the ROBINS-I tool), users must now specify a name for all levels if using the `judgement_labels` argument of `rob_summary()`. **Existing code that uses the `judgement_labels` argument will need to be updated.** 13 | 14 | 15 | * Major updates 16 | * Two new functions for working with the output of `metafor` meta-analyses have been added. `rob_forest()` adds a traffic-light plot to the right hand side of the standard `metafor::forest()` output. `rob_append_weights()` extracts the weights assigned to each study in the meta-analysis and appends them to the risk of bias dataset. A vignette describing these two new functions has been added. 17 | * A template for the QUIPS tool (prognostic studies) has been added. 18 | * The "Generic" template now allows for additional customisation, including control over all text in the resulting figure. 19 | * A new function, `rob_save()`, has been added, which uses data-driven defaults for figure height and width when saving to a file. 20 | * New functionality so that `robvis` now supports "No information" as a judgement has been added. 21 | * An improved colour scheme for the `colour = "colourblind"`argument has been added. 22 | * The argument for the generic template has changed from "ROB1" to "Generic". To ensure backward compatibility, the "ROB1" argument is still accepted, but a message is returned to indicate that it may be depreciated in the future. 23 | * The "Generic" template has been updated, so that it no longer maps "Serious" and "Critical" to the same colour/symbol. 24 | * The `overall` argument in `rob_summary()` now bolds the "Overall" axis label. 25 | 26 | * Minor updates 27 | * A major refactoring of the code base has taken place to allow for future template specific functionality. 28 | * Improved test coverage. 29 | * Allowed for US spelling of "colourblind"" 30 | * `rob_tools()` now returns a message indicating the availability of templates for each function. 31 | 32 | # robvis 0.3.0 (October 2019) 33 | 34 | * Major updates 35 | * `rob_traffic_light()` can now handle a summary table with or without a "Weight column". `rob_summary()` still requires a "Weight" column, as it is strongly encouraged that weights be used to create the summary barplot. 36 | * Functions can now handle summary tables with less than the expected number of judgments. For example, for ROB2, a sheet with only "Low" and "Some concerns" would cause the resulting graph to be inverted and mess up the ordering of the legend. This issue is now fixed for both `rob_summary()` and `rob_traffic_light()`. 37 | * The shapes indicating the risk-of-bias level in `rob_traffic_light()` have been updated. 38 | * `rob_traffic_light()` no longer orders studies alphabetically, instead retaining the order from the uploaded CSV. 39 | * The order of the domains in `rob_summary()` has been corrected to accurately reflect the order of domains in each tool, rather than presenting them in alphabetical order. 40 | * Legends for `rob_traffic_light()` are now ordered by ascending/descending (depending on the tool) risk of bias. 41 | 42 | * Minor updates 43 | * `CODE_OF_CONDUCT` and `CONTRIBUTING` documents have been added to the GitHub repo. 44 | * A PR template has been added to the GitHub repo. 45 | 46 | 47 | # robvis 0.2.0 (May 2019) 48 | 49 | * Major updates 50 | * Removed "save" argument from both the `rob_summary()` and `rob_traffic_light()` functions. In line with CRAN guidelines, this element was removed as packages should not write to the file system. 51 | * Added "weighted" argument to `rob_summary()` to allow users to choose whether to create a weighted or unweighted barplot. 52 | * Added a new generic template (tool = "ROB1") which allows users to have a nonstandard number of bias domains. This template takes the columns headings of user-defined domains and passes them to the caption of the resulting figure. 53 | 54 | * Minor updates 55 | * New functionality for users to choose color-scheme or provide their own vector of colors for use in the plots. Preset options include traditional "Cochrane" colours and a colourblind friendly palette. 56 | * Improved text processing to allow for imperfect matching of judgments, primarily to allow for differences in cases (e.g. "low" will match with "Low"), minor spelling errors (e.g. "loq" will match with "Low"), and a leading whitespace (e.g. " loq" will match with "Low"). 57 | 58 | 59 | # robvis 0.1.0 (April 2019) 60 | 61 | * Initial working version of package 62 | -------------------------------------------------------------------------------- /R/exampledataprep.R: -------------------------------------------------------------------------------- 1 | # Load datasets 2 | # data_rob1 <- 3 | # tidyr::as_tibble(read.csv( 4 | # "data_raw/data_rob1.csv", 5 | # stringsAsFactors = FALSE, 6 | # header = TRUE, 7 | # fileEncoding = "latin1" 8 | # )) 9 | # data_rob2 <- 10 | # tidyr::as_tibble(read.csv( 11 | # "data_raw/data_rob2.csv", 12 | # stringsAsFactors = FALSE, 13 | # header = TRUE, 14 | # fileEncoding = "latin1" 15 | # )) 16 | # data_rob2_cluster <- 17 | # tidyr::as_tibble(read.csv( 18 | # "data_raw/data_rob2_cluster.csv", 19 | # stringsAsFactors = FALSE, 20 | # header = TRUE, 21 | # fileEncoding = "latin1" 22 | # )) 23 | # data_robins_i <- 24 | # tidyr::as_tibble(read.csv( 25 | # "data_raw/data_robins_i.csv", 26 | # stringsAsFactors = FALSE, 27 | # header = TRUE, 28 | # fileEncoding = "latin1" 29 | # )) 30 | # data_robins_e <- 31 | # tidyr::as_tibble(read.csv( 32 | # "data_raw/data_robins_e.csv", 33 | # stringsAsFactors = FALSE, 34 | # header = TRUE, 35 | # fileEncoding = "latin1" 36 | # )) 37 | # data_quadas <- 38 | # tidyr::as_tibble(read.csv( 39 | # "data_raw/data_quadas.csv", 40 | # stringsAsFactors = FALSE, 41 | # header = TRUE, 42 | # fileEncoding = "latin1" 43 | # )) 44 | # data_quips <- 45 | # tidyr::as_tibble(read.csv( 46 | # "data_raw/data_quips.csv", 47 | # stringsAsFactors = FALSE, 48 | # header = TRUE, 49 | # fileEncoding = "latin1" 50 | # )) 51 | # 52 | # usethis::use_data(data_rob1, overwrite = TRUE) 53 | # usethis::use_data(data_rob2, overwrite = TRUE) 54 | # usethis::use_data(data_rob2_cluster, overwrite = TRUE) 55 | # usethis::use_data(data_quadas, overwrite = TRUE) 56 | # usethis::use_data(data_robins_i, overwrite = TRUE) 57 | # usethis::use_data(data_robins_e, overwrite = TRUE) 58 | # usethis::use_data(data_quips, overwrite = TRUE) 59 | 60 | 61 | 62 | # data_bias_direction <- 63 | # tidyr::as_tibble(read.csv( 64 | # "data_raw/bias_direction.csv", 65 | # stringsAsFactors = FALSE, 66 | # header = TRUE, 67 | # fileEncoding = "latin1" 68 | # )) %>% 69 | # select(-c(X,X.1)) 70 | # usethis::use_data(data_bias_direction, overwrite = TRUE) 71 | -------------------------------------------------------------------------------- /R/helpers-metafor.R: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # The functions contained in this file were written by Wolfgang Viechtbauer as 3 | # part of his {metafor} (https://www.metafor-project.org/doku.php) package. 4 | 5 | # As rob_forest() builds on the metafor::forest() function, there were 6 | # some internal {metafor} functions needed to properly render the plot. 7 | 8 | ############################################################################ 9 | 10 | .pval <- function(p, digits=4, showeq=FALSE, sep="", add0=FALSE) { 11 | 12 | digits <- max(digits, 1) 13 | cutoff <- paste(c(".", rep(0,digits-1),1), collapse="") 14 | ncutoff <- as.numeric(cutoff) 15 | 16 | ifelse(is.na(p), paste0(ifelse(showeq, "=", ""), sep, NA), 17 | ifelse(p >= ncutoff, paste0(ifelse(showeq, "=", ""), sep, formatC(p, digits=digits, format="f")), 18 | paste0("<", sep, ifelse(add0, "0", ""), cutoff))) 19 | 20 | } 21 | 22 | mlabfun <- function(text, res) { 23 | 24 | list(bquote(paste(.(text), 25 | " (", 26 | # " Q = ", .(formatC(res$QE, digits=2, format="f")), 27 | # ", df = ", .(res$k - res$p), 28 | "p ", .(.pval(res$pval, digits=2, showeq=TRUE, sep=" ")), "; ", 29 | I^2, " = ", .(formatC(res$I2, digits=1, format="f")), "%, ", 30 | tau^2, " = ", .(formatC(res$tau2, digits=2, format="f")), ")"))) 31 | 32 | } 33 | 34 | 35 | 36 | annotate_poly <- function(yi, ci.lb, ci.ub, atransf = exp, textpos = 2, width, rows, cex=1.2){ 37 | 38 | if (is.function(atransf)) { 39 | 40 | annotext <- cbind(sapply(yi, atransf), sapply(ci.lb, atransf), sapply(ci.ub, atransf)) 41 | ### make sure order of intervals is always increasing 42 | 43 | tmp <- .psort(annotext[,2:3]) 44 | annotext[,2:3] <- tmp 45 | 46 | } else { 47 | 48 | annotext <- cbind(yi, ci.lb, ci.ub) 49 | 50 | } 51 | 52 | annotext <- .fcf(annotext, 2) 53 | 54 | if (missing(width) || is.null(width)) { 55 | width <- apply(annotext, 2, function(x) max(nchar(x))) 56 | } else { 57 | if (length(width) == 1L) 58 | width <- rep(width, ncol(annotext)) 59 | } 60 | 61 | for (j in seq_len(ncol(annotext))) { 62 | annotext[,j] <- formatC(annotext[,j], width=width[j]) 63 | } 64 | 65 | annotext <- cbind(annotext[,1], " [", annotext[,2], ", ", annotext[,3], "]") 66 | annotext <- apply(annotext, 1, paste, collapse="") 67 | graphics::text(x=textpos, rows, labels=annotext, pos=2, cex=cex) 68 | 69 | } 70 | 71 | 72 | .fcf <- function(x, digits) { 73 | 74 | if (all(is.na(x))) { # since formatC(NA, format="f", digits=2) fails 75 | x 76 | } else { 77 | trimws(formatC(x, format="f", digits=digits)) 78 | } 79 | 80 | } 81 | 82 | .psort <- function(x,y) { 83 | 84 | if (is.null(x) || length(x) == 0L) ### need to catch this 85 | return(NULL) 86 | 87 | if (missing(y)) { 88 | if (is.matrix(x)) { 89 | xy <- x 90 | } else { 91 | xy <- rbind(x) ### in case x is just a vector 92 | } 93 | } else { 94 | xy <- cbind(x,y) 95 | } 96 | 97 | n <- nrow(xy) 98 | 99 | for (i in seq_len(n)) { 100 | if (anyNA(xy[i,])) 101 | next 102 | xy[i,] <- sort(xy[i,]) 103 | } 104 | 105 | colnames(xy) <- NULL 106 | 107 | return(xy) 108 | 109 | } 110 | -------------------------------------------------------------------------------- /R/rob_data.R: -------------------------------------------------------------------------------- 1 | #' Example QUADAS-2 assessment dataset 2 | #' 3 | #' @description A data frame containing 12 example assessments performed using 4 | #' the risk-of-bias portion of the QUADAS-2 tool for the assessment of 5 | #' diagnostic accuracy studies. 6 | #' 7 | #' @format A data frame with the following 6 columns: 8 | #' \describe{ 9 | #' \item{Study}{Study identifier} 10 | #' \item{D1}{Domain 1 - Patient Selection} 11 | #' \item{D2}{Domain 2 - Index Test} 12 | #' \item{D3}{Domain 3 - Reference Standard} 13 | #' \item{D4}{Domain 4 - Flow & Timing} 14 | #' \item{Overall}{Overall risk of bias} 15 | #' } 16 | #' @source {Created for this package} 17 | #' @keywords internal 18 | "data_quadas" 19 | 20 | #' Example QUIPS assessment dataset 21 | #' 22 | #' @description A data frame containing 12 example assessments performed using 23 | #' the QUIPS (Quality In Prognosis Studies) tool. 24 | #' 25 | #' @format A data frame with the following 8 columns: 26 | #' \describe{ 27 | #' \item{Study}{Study identifier} 28 | #' \item{D1}{Domain 1 - Bias due to participation} 29 | #' \item{D2}{Domain 2 - Bias due to attrition} 30 | #' \item{D3}{Domain 3 - Bias due to prognostic factor measurement} 31 | #' \item{D4}{Domain 4 - Bias due to outcome measurement} 32 | #' \item{D5}{Domain 5 - Bias due to confounding} 33 | #' \item{D6}{Domain 6 - Bias in statistical analysis and reporting} 34 | #' \item{Overall}{Overall risk of bias} 35 | #' } 36 | #' @source {Created for this package} 37 | #' @keywords internal 38 | "data_quips" 39 | 40 | #' Example ROB1 assessment dataset 41 | #' 42 | #' @description A data frame containing 9 example assessments performed using 43 | #' the RoB1 assessment tool. Note that this dataset is distinct from other 44 | #' example datasets included in this package, in that the column names are the 45 | #' full domain names, rather than domain shortcodes (e.g. D1, D2, etc.). This 46 | #' is because the "Generic" (formerly "RoB1") template offered by 47 | #' \code{robvis} allows users to create custom risk-of-bias plots, and uses 48 | #' the column names of the provided dataset to define the domain names for 49 | #' these custom plots. 50 | #' 51 | #' @format A data frame with the following 9 columns: 52 | #' \describe{ 53 | #' \item{Study}{Study identifier} 54 | #' \item{Random.sequence.generation}{Domain 1} 55 | #' \item{Allocation.concealment}{Domain 2} 56 | #' \item{Blinding.of.participants.and.personnel}{Domain 3} 57 | #' \item{Blinding.of.outcome.assessment}{Domain 4} 58 | #' \item{Incomplete.outcome.data}{Domain 5} 59 | #' \item{Selective.reporting}{Domain 6} 60 | #' \item{Other.sources.of.bias}{Domain 7} 61 | #' \item{Overall}{Overall risk of bias} 62 | #' } 63 | #' @source {Created for this package} 64 | #' @keywords internal 65 | 66 | "data_rob1" 67 | 68 | #' Example ROB2.0 assessment dataset 69 | #' 70 | #' @description A data frame containing 9 example assessments performed using 71 | #' the RoB 2.0 tool for randomised controlled trials. 72 | #' 73 | #' @format A data frame with the following 7 columns: 74 | #' \describe{ 75 | #' \item{Study}{Study identifier} 76 | #' \item{D1}{Domain 1 - Bias arising from the randomization process} 77 | #' \item{D2}{Domain 2 - Bias due to deviations from intended intervention} 78 | #' \item{D3}{Domain 3 - Bias due to missing outcome data} 79 | #' \item{D4}{Domain 4 - Bias in measurement of the outcome} 80 | #' \item{D5}{Domain 5 - Bias in selection of the reported result} 81 | #' \item{Overall}{Overall risk of bias} 82 | #' } 83 | #' @source {Created for this package} 84 | #' @keywords internal 85 | "data_rob2" 86 | 87 | #' Example ROB2.0 (cluster variant) assessment dataset 88 | #' 89 | #' @description A data frame containing 9 example assessments performed using 90 | #' the cluster-randomised version of the RoB 2.0 tool. 91 | #' 92 | #' @format A data frame with the following 7 columns: 93 | #' 94 | #' \describe{ 95 | #' \item{Study}{Study identifier} 96 | #' \item{D1}{Domain 1 - Bias arising from the randomization process} 97 | #' \item{D1b}{Domain 1b - Bias arising from the timing of identification and recruitment of Individual participants in relation to timing of randomization} 98 | #' \item{D2}{Domain 2 - Bias due to deviations from intended intervention} 99 | #' \item{D3}{Domain 3 - Bias due to missing outcome data} 100 | #' \item{D4}{Domain 4 - Bias in measurement of the outcome} 101 | #' \item{D5}{Domain 5 - Bias in selection of the reported result} 102 | #' \item{Overall}{Overall risk of bias} 103 | #' } 104 | #' @source {Created for this package} 105 | #' @keywords internal 106 | 107 | "data_rob2_cluster" 108 | 109 | #' Example ROBINS-I assessment dataset 110 | #' 111 | #' @description A data frame containing 10 example assessments performed using 112 | #' the ROBINS-I (Risk Of Bias In Non-randomised Studies - of Interventions) tool. 113 | #' 114 | #' @format A data frame with the following 9 columns: 115 | #' 116 | #' \describe{ 117 | #' \item{Study}{Study identifier} 118 | #' \item{D1}{Domain 1 - Bias due to confounding} 119 | #' \item{D2}{Domain 2 - Bias due to selection of participants} 120 | #' \item{D3}{Domain 3 - Bias in classification of interventions} 121 | #' \item{D4}{Domain 4 - Bias due to deviations from intended interventions} 122 | #' \item{D5}{Domain 5 - Bias due to missing data} 123 | #' \item{D6}{Domain 6 - Bias in measurement of outcomes} 124 | #' \item{D7}{Domain 7 - Bias in selection of the reported result} 125 | #' \item{Overall}{Overall risk of bias} 126 | #' } 127 | #' @source {Created for this package} 128 | #' @keywords internal 129 | 130 | "data_robins_i" 131 | 132 | #' Example ROBINS-E assessment 133 | #' 134 | #' @description A data frame containing 10 example assessments performed using 135 | #' the ROBINS-E (Risk Of Bias In Non-randomised Studies - of Exposures) tool. 136 | #' 137 | #' @format A data frame with the following 9 columns: 138 | #' 139 | #' \describe{ 140 | #' \item{Study}{Study identifier} 141 | #' \item{D1}{Domain 1 - Bias due to confounding} 142 | #' \item{D2}{Domain 2 - Bias arising from measurement of the exposure} 143 | #' \item{D3}{Domain 3 - Bias in selection of participants into the study (or into the analysis)} 144 | #' \item{D4}{Domain 4 - Bias due to post-exposure interventions} 145 | #' \item{D5}{Domain 5 - Bias due to missing data} 146 | #' \item{D6}{Domain 6 - Bias arising from measurement of the outcome} 147 | #' \item{D7}{Domain 7 - Bias in selection of the reported result} 148 | #' \item{Overall}{Overall risk of bias} 149 | #' } 150 | #' @source {Created for this package} 151 | #' @keywords internal 152 | 153 | "data_robins_e" 154 | 155 | # TODO Update data documentation for this dataframe 156 | 157 | #'@title Example directional risk-of-bias dataset 158 | #'@description This dataset is include to support experimental aspects of the 159 | #' package. 160 | #'@format A data frame with 20 rows and 27 variables: 161 | #' \describe{ 162 | #' \item{\code{result_id}}{integer COLUMN_DESCRIPTION} 163 | #' \item{\code{study}}{character COLUMN_DESCRIPTION} 164 | #' \item{\code{type}}{character COLUMN_DESCRIPTION} 165 | #' \item{\code{yi}}{double COLUMN_DESCRIPTION} 166 | #' \item{\code{vi}}{double COLUMN_DESCRIPTION} 167 | #' \item{\code{d1j}}{character COLUMN_DESCRIPTION} 168 | #' \item{\code{d1t}}{character COLUMN_DESCRIPTION} 169 | #' \item{\code{d1d}}{character COLUMN_DESCRIPTION} 170 | #' \item{\code{d2j}}{character COLUMN_DESCRIPTION} 171 | #' \item{\code{d2t}}{character COLUMN_DESCRIPTION} 172 | #' \item{\code{d2d}}{character COLUMN_DESCRIPTION} 173 | #' \item{\code{d3j}}{character COLUMN_DESCRIPTION} 174 | #' \item{\code{d3t}}{character COLUMN_DESCRIPTION} 175 | #' \item{\code{d3d}}{character COLUMN_DESCRIPTION} 176 | #' \item{\code{d4j}}{character COLUMN_DESCRIPTION} 177 | #' \item{\code{d4t}}{character COLUMN_DESCRIPTION} 178 | #' \item{\code{d4d}}{character COLUMN_DESCRIPTION} 179 | #' \item{\code{d5j}}{character COLUMN_DESCRIPTION} 180 | #' \item{\code{d5t}}{character COLUMN_DESCRIPTION} 181 | #' \item{\code{d5d}}{character COLUMN_DESCRIPTION} 182 | #' \item{\code{d6j}}{character COLUMN_DESCRIPTION} 183 | #' \item{\code{d6t}}{character COLUMN_DESCRIPTION} 184 | #' \item{\code{d6d}}{character COLUMN_DESCRIPTION} 185 | #' \item{\code{d7j}}{character COLUMN_DESCRIPTION} 186 | #' \item{\code{d7t}}{character COLUMN_DESCRIPTION} 187 | #' \item{\code{d7d}}{character COLUMN_DESCRIPTION} 188 | #' \item{\code{overall}}{character COLUMN_DESCRIPTION} 189 | #'} 190 | #'@source {Created for this package} 191 | #'@keywords internal 192 | 193 | "data_bias_direction" 194 | -------------------------------------------------------------------------------- /R/rob_direction.R: -------------------------------------------------------------------------------- 1 | # TODO add argument that prevents subgroup summary estimates - in this case, each subgroup will need to be one row closer to each other 2 | # TODO Finish description of function 3 | 4 | #' Bias direction plots 5 | #' 6 | #' @description Used to 7 | #' 8 | #' @param dat Dataframe 9 | #' @param vi Vector containing the sampling variances (normally defined as the column within the dataset, i.e. dat$vi). Note: either vi or sei must be set. 10 | #' @param sei Vector containing the corresponding standard errors (normally defined as the column within the dataset, i.e. dat$sei). Note: either vi or sei must be set. 11 | #' @param title Graph title 12 | #' @param legend_cex Expansion factor for figure legend. 13 | #' @param grouping Variable of the provided dataset by which the resulting plot will be stratified. Often will study design or overall risk-of-bias level. 14 | #' @param grouping_levels Ordering of grouping variable. Note: the levels will be plotted 15 | #' in order, starting at the bottom of the graph (i.e. the last item in the 16 | #' vector will be placed at the top of the graph) 17 | #' @param label_subgroup_summary Annotation text for subgroup label 18 | #' @param ... Other arguments to pass to metafor::forest 19 | #' 20 | #' @keywords internal 21 | 22 | rob_direction <- 23 | function(dat, 24 | vi = NULL, 25 | sei = NULL, 26 | title = NULL, 27 | legend_cex = 0.9, 28 | grouping = "type", 29 | grouping_levels = c("MR","NRSI","NRSE","RCT"), 30 | label_subgroup_summary = "RE Model for Subgroup", 31 | ...) { 32 | 33 | ### calculate log risk ratios and corresponding sampling variances (and use 34 | ### the 'slab' argument to store study labels as part of the data frame) 35 | 36 | if (("study" %in% colnames(dat)) == FALSE) { 37 | dat$study <- paste("Study", 1:nrow(dat)) 38 | } 39 | 40 | rob_levels = c("Low","Moderate","High","Critical") 41 | 42 | dat <- dat %>% 43 | dplyr::mutate(type = factor(type, levels = grouping_levels)) %>% 44 | dplyr::mutate(overall = factor(overall, levels = rob_levels)) %>% 45 | dplyr::arrange(type, overall, dplyr::desc(study)) 46 | 47 | dat[is.na(dat)] <- "None" 48 | 49 | 50 | # Use this to define the gaps between different groups 51 | # Will be important when adding argument to prevent subgroup analyses 52 | offset_n <- 3 53 | 54 | dat_rob_vec <- dat %>% 55 | dplyr::mutate(row_n = 1:dplyr::n()) %>% 56 | dplyr::group_by(type) %>% 57 | dplyr::summarise(n=dplyr::n(),max = max(row_n), min = min(row_n)) %>% 58 | dplyr::mutate(offset = seq(1,length(unique(.$type))*offset_n,by=offset_n)) %>% 59 | dplyr::mutate(min = min+offset, max =max+offset, heading = max+1, stats = min-1.25) %>% 60 | dplyr::mutate(min = ifelse(n==1,min-1,min), 61 | max = ifelse(n==1,max-1,max), 62 | heading = ifelse(n==1,heading-1,heading)) 63 | 64 | if (length(unique(dat$type))==1) { 65 | dat_rob_vec <- dat_rob_vec %>% 66 | dplyr::mutate(dplyr::across(c(min, max, heading),~.-1)) 67 | } 68 | 69 | rows <- c() 70 | 71 | for (i in 1:nrow(dat_rob_vec)) { 72 | 73 | rows <-c(rows, dat_rob_vec$min[i]:dat_rob_vec$max[i]) 74 | 75 | } 76 | 77 | arg <- list(...) 78 | 79 | if (is.null(arg$at)) { 80 | x_adj <- log(3) 81 | } else { 82 | x_adj <- arg$at[3] 83 | } 84 | 85 | if (is.null(arg$x_min)) { 86 | x_min = -10 87 | } else { 88 | x_min <- arg$x_min 89 | } 90 | 91 | x_max = 4.6 - log(3) + x_adj 92 | textpos <- c(x_min, x_max-1) 93 | y_max <- max(rows)+4 94 | 95 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 96 | # Deal with adding rob data 97 | 98 | dat <- dat %>% 99 | dplyr::mutate(dplyr::across(-c(result_id,study,type,yi,vi), clean_data)) 100 | 101 | # Combine direction and type 102 | for (j in paste0("d",1:7)) { 103 | for (i in 1:nrow(dat)) { 104 | dat[i,paste0(j,"d")] <- paste0(dat[i,paste0(j,"d")],dat[i,paste0(j,"t")]) 105 | } 106 | } 107 | 108 | x_pos <- seq(x_max, by = 0.45, length.out = 9 - 2) 109 | 110 | x_overall_pos <- max(x_pos) + 1 111 | 112 | # Convenience vector, specifying x-axis positions for all risk of bias columns 113 | header_row <- c(x_pos, x_overall_pos) 114 | 115 | legend_pos <- x_max+(max(header_row)-min(header_row))/2 116 | 117 | # New right-hand x-axis limit 118 | new_x_lim <- x_overall_pos + .5 119 | 120 | rob_colours <- get_colour("ROBINS-I", "cochrane") 121 | 122 | judgements<- c( "High risk of bias", 123 | "Moderate risk of bias", 124 | "Low risk of bias") 125 | cols <- c( 126 | h = rob_colours$high_colour, 127 | m = rob_colours$concerns_colour, 128 | l = rob_colours$low_colour, 129 | n = rob_colours$ni_colour, 130 | x = "transparent" 131 | ) 132 | 133 | syms <- c(ua = "?", 134 | up = "?", 135 | lp = "<", 136 | rp = ">", 137 | la = "\U2190", 138 | ra = "\U2192", 139 | l = "\U2190", 140 | r = "\U2192", 141 | xx = "", 142 | x = "") 143 | 144 | shapes <- c(c = 15, 145 | h = 15, 146 | m = 15, 147 | l = 15, 148 | n = 15, 149 | x = 15) 150 | 151 | 152 | rob_psize = 3 153 | tsize <- rob_psize * 0.3 154 | 155 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 156 | # Make forest plot 157 | 158 | ### set up forest plot (with 2x2 table counts added; the 'rows' argument is 159 | ### used to specify in which rows the outcomes will be plotted) 160 | metafor::forest(x = dat$yi, 161 | vi = vi, 162 | sei = sei, 163 | xlim=c(x_min, new_x_lim), 164 | atransf=exp, 165 | slab = paste0(" ", dat$study), 166 | cex=1.2, 167 | ylim=c(-1.5, y_max), 168 | rows=rows, 169 | textpos = textpos, 170 | # mlab = "", 171 | header="Studies", 172 | ... 173 | ) 174 | 175 | ### set font expansion factor (as in forest() above) and use a bold font 176 | op <- graphics::par(font=2) 177 | 178 | ### switch to bold italic font 179 | graphics::par(font=2) 180 | 181 | ### add text for the subgroups 182 | for (i in 1:nrow(dat_rob_vec)) { 183 | 184 | graphics::text(x_min, dat_rob_vec$heading[i], pos=4, dat_rob_vec$type[i], cex = 1.2) 185 | } 186 | 187 | ### set par back to the original settings 188 | graphics::par(op) 189 | 190 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 191 | # Add risk of bias data 192 | 193 | headers <- c("D1", "D2", "D3", "D4", "D5", "D6","D7", "O") 194 | 195 | graphics::par(font = 2) 196 | # Need to add handling of top here 197 | graphics::text(mean(header_row), y_max, labels = "Risk of Bias", cex=1.2) 198 | graphics::text(header_row, y_max-2 + 1, labels = headers, cex=1.2) 199 | graphics::par(op) 200 | 201 | # Plot domain points 202 | for (j in 1:length(x_pos)) { 203 | graphics::points( 204 | x = rep(x_pos[j], length(rows)), 205 | y = rows, 206 | pch = shapes[dat[[paste0("d", j,"j")]]], 207 | col = scales::alpha(cols[dat[[paste0("d", j,"j")]]],0.6), 208 | cex = rob_psize 209 | ) 210 | graphics::text(x_pos[j], rows, syms[dat[[paste0("d", j,"d")]]], cex = tsize) 211 | } 212 | 213 | graphics::points( 214 | rep(x_overall_pos, length(rows)), 215 | rows, 216 | pch = 15, 217 | col = scales::alpha(cols[dat[["overall"]]],0.6), 218 | cex = rob_psize 219 | ) 220 | # graphics::text(x_overall_pos, rows, syms[dat[["overall"]]], cex = tsize) 221 | graphics::par(op) 222 | 223 | # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 224 | # 225 | 226 | 227 | 228 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 229 | # Add sub-group, summary polygons & text 230 | 231 | rma_flexi <- function(x) { 232 | metafor::rma( 233 | yi, 234 | vi, 235 | subset = (type == x), 236 | data = dat, 237 | method = "DL" 238 | ) 239 | } 240 | 241 | 242 | res <- purrr::map(dat_rob_vec$type, rma_flexi) 243 | 244 | if (length(unique(dat$type))>1) { 245 | 246 | ### add summary polygons for the three subgroups 247 | for (i in 1:nrow(dat_rob_vec)) { 248 | 249 | if (length(res[[i]]$slab) == 1) { 250 | next 251 | } 252 | 253 | metafor::addpoly( 254 | res[[i]], 255 | #fonts = 1, 256 | row = dat_rob_vec$stats[i], 257 | cex = 1.2, 258 | textpos=textpos, 259 | atransf = exp, 260 | annotate = F, 261 | mlab = mlabfun(label_subgroup_summary, res[[i]]) 262 | ) 263 | 264 | annotate_poly(res[[i]]$b, 265 | res[[i]]$ci.lb, 266 | res[[i]]$ci.ub, 267 | textpos = textpos, 268 | rows = dat_rob_vec$stats[[i]]) 269 | 270 | } 271 | } 272 | 273 | # 274 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 275 | 276 | # if (nrow(dat)>9) { 277 | # 278 | # # Fit meta-regression model to test for subgroup differences 279 | # 280 | # if (!is.null(sei)) { 281 | # 282 | # res <- rma(yi, vi, mods = ~ type, data = dat, method = "DL") 283 | # 284 | # } else { 285 | # 286 | # res <- rma(yi, sei=sei, mods = ~ type, data = dat, method = "DL") 287 | # 288 | # } 289 | # 290 | # ### add text for the test of subgroup differences 291 | # text(x_min,-1.8, pos = 4, cex = 1.2, bquote( 292 | # paste( 293 | # "Test for Subgroup Differences: ", 294 | # Q[M], 295 | # " = ", 296 | # .(formatC( 297 | # res$QM, digits = 2, format = "f" 298 | # )), 299 | # ", df = ", 300 | # .(res$p - 1), 301 | # ", p = ", 302 | # .(formatC( 303 | # res$QMp, digits = 2, format = "f" 304 | # )) 305 | # ) 306 | # )) 307 | # } 308 | 309 | 310 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 311 | 312 | if(!is.null(title)){ 313 | graphics::par(font = 2) 314 | graphics::text(x_min, y_max, pos=4, bquote(bold(underline(.(title)))), cex = 1.2) 315 | graphics::par(op) 316 | } 317 | 318 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 319 | 320 | graphics::legend( 321 | legend_pos-1.625, 322 | -1.7, 323 | c(judgements), 324 | pch = c(15,15,15,16,50), 325 | xjust = 0.5, 326 | col = c(cols[1:3],"white","white"), 327 | xpd = TRUE, 328 | title = parse(text = "bold(\"Extent of bias\")"), 329 | title.adj = 0.05, 330 | cex = legend_cex, 331 | pt.cex = legend_cex-.1, 332 | y.intersp = 0.7 333 | ) 334 | 335 | graphics::legend( 336 | legend_pos+0.95, 337 | -1.7, 338 | c("\U2190 \U2192 Additive bias "," < > Proportional bias", " ? Unpredictable"), 339 | xjust = 0.5, 340 | xpd = TRUE, 341 | adj = 0.15, 342 | title = parse(text = "bold(\"Type of bias\")"), 343 | title.adj = 0.05, 344 | cex = legend_cex, 345 | pt.cex = legend_cex, 346 | y.intersp = 0.7 347 | ) 348 | 349 | 350 | } 351 | -------------------------------------------------------------------------------- /R/rob_dummy.R: -------------------------------------------------------------------------------- 1 | #' Create "realistic" dummy risk of bias assessment data 2 | #' 3 | #' @description This function returns N example risk of bias assessments for the 4 | #' tool specified, where N is set by the user. Assessments are "realistic" in 5 | #' that the judgment in the overall column is set to the highest judgement 6 | #' across the domains for a given study, reflecting the recommendations of the 7 | #' tool creators. 8 | #' 9 | #' @param n Number of assessments to create 10 | #' @param tool Tool used for assessment (see rob_tools()). Default is "ROB2". 11 | #' @param study Should the returned dataframe contain a "Study" column. Default 12 | #' is true. 13 | #' 14 | #' @family helper 15 | #' 16 | #' @export 17 | #' @importFrom magrittr %>% 18 | 19 | rob_dummy <- function(n, tool = "ROB2", study = TRUE){ 20 | # TODO Need to work out how to handle the cluster/generic tools 21 | 22 | if (tool == "ROB2") { 23 | prob = c(.025, .5, .2, 0.1) 24 | ncol = 5 25 | } 26 | 27 | if (tool == "ROBINS-E") { 28 | prob = c(.025, .45, .55, 0.25, 0.025) 29 | ncol = 7 30 | } 31 | 32 | if (tool == "ROBINS-I") { 33 | prob = c(.025, .55, .45, 0.25, 0.025) 34 | ncol = 7 35 | } 36 | 37 | if (tool == "QUADAS-2") { 38 | prob = c(.025, .5, .2, 0.1) 39 | ncol = 4 40 | } 41 | 42 | values = rev(get_judgements(tool)) 43 | 44 | v_values = seq_len(length(values)) 45 | 46 | dat <- matrix(nrow = n, ncol = ncol) %>% 47 | as.data.frame() %>% 48 | dplyr::mutate(dplyr::across(dplyr::everything(), 49 | ~ sample(v_values, dplyr::n(), T, prob))) 50 | 51 | 52 | # Probability of a low judgement in D1 of these tools is v small 53 | # But need high prob of Low for other domains in these tools 54 | if(tool %in% c("ROBINS-I", "ROBINS-E")){ 55 | dat[which(dat[,1]==2),1] <- 3 56 | } 57 | 58 | dat <- dat %>% 59 | dplyr::rowwise() %>% 60 | dplyr::mutate(Overall = max(dplyr::across(dplyr::everything()))) %>% 61 | dplyr::mutate(dplyr::across(dplyr::everything(), as.character)) %>% 62 | dplyr::mutate(dplyr::across(dplyr::everything(), ~dplyr::case_when(. == "1" ~ values[1], 63 | . == "2" ~ values[2], 64 | . == "3" ~ values[3], 65 | . == "4" ~ values[4], 66 | . == "5" ~ values[5], 67 | . == "6" ~ values[6], 68 | . == "7" ~ values[7], 69 | T ~ .))) %>% 70 | dplyr::ungroup() %>% 71 | dplyr::rename_with(~gsub("V","D",.), .cols = dplyr::starts_with("V")) %>% 72 | dplyr::select(dplyr::starts_with("D"),Overall) 73 | 74 | 75 | 76 | if (study) { 77 | dat <- dat %>% 78 | dplyr::mutate(Study = paste("Study", 1:dplyr::n())) %>% 79 | dplyr::select(Study, dplyr::everything()) 80 | } 81 | 82 | return(dat) 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /R/rob_forest.R: -------------------------------------------------------------------------------- 1 | #' @title Append a risk-of-bias traffic-light plot to a forest plot 2 | #' 3 | #' @description A wrapper for metafor::forest function, which adds a risk of 4 | #' bias traffic-light plot to the right-hand side of the forest plot. The 5 | #' heavy lifting for this function is done by metafor. Note that if not 6 | #' specified as additional arguments, this functions sets the header argument 7 | #' of metafor::forest() to TRUE. 8 | #' 9 | #' @param res Output from metafor meta-analysis function 10 | #' @param rob_tool The risk-of-bias assessment tool used to perform the 11 | #' assessments 12 | #' @param rob_me Optional value defining the result of the Risk-Of-Bias due to 13 | #' Missing Evidence (ROB-ME) assessment for this synthesis. By default (rob_me 14 | #' = NULL), this is omitted from the plot. 15 | #' @param rob_levels Vector of judgments [e.g. c("Low","Some 16 | #' concerns","High","Critical")] that controls the ordering of subgroups 17 | #' within the plot 18 | #' @param title Text to use for plot title 19 | #' @param rob_legend Logical specifying whether a legend for the risk-of-bias 20 | #' plot should be shown. Default is TRUE. 21 | #' @param rob_legend_cex Expansion factor for the risk-of-bias legend 22 | #' @param ... Additional arguments to be passed to the metafor::forest() 23 | #' function 24 | #' 25 | #' @family main 26 | #' 27 | #' @export 28 | 29 | rob_forest <- 30 | function(res, 31 | rob_tool = "ROB2", 32 | rob_me = NULL, 33 | rob_levels = NULL, 34 | title = NULL, 35 | rob_legend = TRUE, 36 | rob_legend_cex = 0.9, 37 | ...) { 38 | 39 | 40 | # Check that res is of class RMA 41 | if (!("rma" %in% class(res))) { 42 | stop("Result objects need to be of class \"meta\" - output from metafor package functions") 43 | } 44 | 45 | # Check that the specified tool is supported 46 | check_tool(rob_tool, forest = TRUE) 47 | 48 | 49 | if (is.null(rob_levels)) { 50 | rob_levels <- get_judgements(rob_tool) 51 | } 52 | 53 | colnames(res$data) <- stringr::str_to_lower(colnames(res$data)) 54 | 55 | dat <- res$data %>% 56 | dplyr::mutate(overall = factor(overall, levels = rob_levels)) %>% 57 | dplyr::arrange(overall, dplyr::desc(author)) 58 | 59 | 60 | # Get maximum domain 61 | 62 | max_domain_column <- dat %>% 63 | dplyr::select(dplyr::matches("^d.$")) %>% 64 | colnames() %>% 65 | gsub("d","",.) %>% 66 | as.numeric() %>% 67 | max() + 2 68 | 69 | 70 | # Use this to define the gaps between different groups 71 | # Will be important when adding argument to prevent subgroup analyses 72 | offset_n <- 3 73 | 74 | dat_rob_vec <- dat %>% 75 | dplyr::mutate(row_n = 1:dplyr::n()) %>% 76 | dplyr::group_by(overall) %>% 77 | dplyr::summarise(n=dplyr::n(),max = max(row_n), min = min(row_n)) %>% 78 | dplyr::mutate(offset = seq(1,length(unique(.$overall))*offset_n,by=offset_n)) %>% 79 | dplyr::mutate(min = min+offset, max =max+offset, heading = max+1, stats = min-1.25) %>% 80 | dplyr::mutate(min = ifelse(n==1,min-1,min), 81 | max = ifelse(n==1,max-1,max), 82 | heading = ifelse(n==1,heading-1,heading)) 83 | 84 | if (length(unique(dat$overall))==1) { 85 | dat_rob_vec <- dat_rob_vec %>% 86 | dplyr::mutate(dplyr::across(c(min, max, heading),~.-1)) 87 | } 88 | 89 | res <- stats::update(res, data = dat) 90 | 91 | rows <- c() 92 | 93 | for (i in 1:nrow(dat_rob_vec)) { 94 | 95 | rows <-c(rows, dat_rob_vec$min[i]:dat_rob_vec$max[i]) 96 | 97 | } 98 | 99 | arg <- list(...) 100 | 101 | if (is.null(arg$at)) { 102 | x_adj <- log(3) 103 | } else { 104 | x_adj <- arg$at[3] 105 | } 106 | 107 | if (is.null(arg$x_min)) { 108 | x_min = -10 109 | } else { 110 | x_min <- arg$x_min 111 | arg$x_min <- NULL 112 | } 113 | 114 | x_max = 4.6 - log(3) + x_adj 115 | textpos <- c(x_min, x_max-0.5) 116 | y_max <- max(rows)+4 117 | 118 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 119 | # Deal with adding rob data 120 | 121 | dat <- dat %>% 122 | dplyr::mutate(dplyr::across(dplyr::matches("^d.$|overall"), 123 | clean_data)) 124 | 125 | x_pos <- seq(x_max, by = 0.45, length.out = max_domain_column - 2) 126 | 127 | x_overall_pos <- max(x_pos) + 1 128 | 129 | # Convenience vector, specifying x-axis positions for all risk of bias columns 130 | header_row <- c(x_pos, x_overall_pos) 131 | 132 | legend_pos <- x_max+(max(header_row)-min(header_row))/2 133 | 134 | # New right-hand x-axis limit 135 | new_x_lim <- x_overall_pos + .5 136 | 137 | rob_colours <- get_colour(rob_tool, "cochrane") 138 | 139 | if (rob_tool %in% c("ROB2", "QUADAS-2")) { 140 | judgements<- c("High risk of bias", 141 | "Some concerns", 142 | "Low risk of bias", 143 | "No information") 144 | 145 | cols <- c( 146 | h = rob_colours$high_colour, 147 | s = rob_colours$concerns_colour, 148 | l = rob_colours$low_colour, 149 | n = rob_colours$ni_colour, 150 | x = rob_colours$na_colour 151 | ) 152 | 153 | syms <- c(h = "X", 154 | s = "-", 155 | l = "+", 156 | n = "?", 157 | x = "" 158 | ) 159 | 160 | shapes <- c(h = 15, 161 | s = 15, 162 | l = 15, 163 | n = 15, 164 | x = 15 165 | ) 166 | } 167 | 168 | if (rob_tool == "ROBINS-I") { 169 | judgements<- c("Critical risk of bias", 170 | "Serious risk of bias", 171 | "Moderate risk of bias", 172 | "Low risk of bias", 173 | "No information") 174 | cols <- c( 175 | c = rob_colours$critical_colour, 176 | s = rob_colours$high_colour, 177 | m = rob_colours$concerns_colour, 178 | l = rob_colours$low_colour, 179 | n = rob_colours$ni_colour, 180 | x = rob_colours$na_colour 181 | ) 182 | 183 | syms <- c(c = "!", 184 | s = "X", 185 | m = "-", 186 | l = "+", 187 | n = "", 188 | x = "") 189 | 190 | 191 | shapes <- c(c = 15, 192 | s = 15, 193 | m = 15, 194 | l = 15, 195 | n = 15, 196 | x = 15) 197 | 198 | } 199 | 200 | 201 | if (rob_tool == "ROBINS-E") { 202 | judgements<- c("Very high risk of bias", 203 | "High risk of bias", 204 | "Some concerns", 205 | "Low risk of bias", 206 | "No information") 207 | cols <- c( 208 | v = rob_colours$critical_colour, 209 | h = rob_colours$high_colour, 210 | s = rob_colours$concerns_colour, 211 | l = rob_colours$low_colour, 212 | n = rob_colours$ni_colour, 213 | x = rob_colours$na_colour 214 | ) 215 | 216 | syms <- c(v = "!", 217 | h = "X", 218 | s = "-", 219 | l = "+", 220 | n = "", 221 | x = "") 222 | 223 | 224 | shapes <- c(v = 15, 225 | h = 15, 226 | s = 15, 227 | l = 15, 228 | n = 15, 229 | x = 15) 230 | 231 | } 232 | 233 | rob_psize = 3 234 | tsize <- rob_psize * 0.3 235 | 236 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 237 | # Make forest plot 238 | 239 | if (is.null(arg$header)) { 240 | arg$header = "Author(s) and Year" 241 | } 242 | 243 | if (is.null(arg$addpred)) { 244 | arg$addpred = TRUE 245 | } 246 | 247 | if (is.null(arg$mlab)) { 248 | arg$mlab = mlabfun("RE Model for all studies", res) 249 | } 250 | 251 | arg$x <- res 252 | arg$xlim <- c(x_min, new_x_lim) 253 | arg$atransf <- "exp" 254 | arg$cex <- 1.2 255 | arg$ylim=c(-1.5, y_max) 256 | arg$rows <- rows 257 | arg$textpos <- textpos 258 | 259 | ### set up forest plot (with 2x2 table counts added; the 'rows' argument is 260 | ### used to specify in which rows the outcomes will be plotted) 261 | # metafor::forest(res, xlim=c(x_min, new_x_lim), atransf=exp, 262 | # cex=1.2, ylim=c(-1.5, y_max), rows=rows, textpos=textpos, 263 | # mlab=mlab, addpred = addpred) 264 | 265 | do.call(metafor::forest, arg) 266 | 267 | 268 | ### set font expansion factor (as in forest() above) and use a bold font 269 | 270 | if (any(grepl("\\*", dat$year))) { 271 | dat <- dat %>% 272 | dplyr::mutate(measure = dplyr::case_when(grepl("\\*", year) ~ "OR", 273 | T ~ "HR")) 274 | 275 | graphics::text(rep(-2.25,length(rows)), rows, dat$measure, cex = 1.2 ) 276 | 277 | graphics::par(font = 2) 278 | graphics::text(-2.25, y_max - 1, labels = "Measure", cex=1.2) 279 | } 280 | 281 | op <- graphics::par(font=2) 282 | 283 | ### switch to bold italic font 284 | graphics::par(font=2) 285 | 286 | ### add text for the subgroups 287 | for (i in 1:nrow(dat_rob_vec)) { 288 | 289 | graphics::text(x_min, dat_rob_vec$heading[i], pos=4, dat_rob_vec$overall[i], cex = 1.2) 290 | } 291 | 292 | ### set par back to the original settings 293 | graphics::par(op) 294 | 295 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 296 | # Add risk of bias data 297 | 298 | headers <- c(paste0("D",seq_len(max_domain_column-2)),"O") 299 | 300 | graphics::par(font = 2) 301 | # Need to add handling of top here 302 | graphics::text(mean(header_row), y_max, labels = "Risk of Bias", cex=1.2) 303 | graphics::text(header_row, y_max-2 + 1, labels = headers, cex=1.2) 304 | graphics::par(op) 305 | 306 | # Plot domain points 307 | for (j in 1:length(x_pos)) { 308 | graphics::points( 309 | x = rep(x_pos[j], length(rows)), 310 | y = rows, 311 | pch = shapes[dat[[paste0("d", j)]]], 312 | col = scales::alpha(cols[dat[[paste0("d", j)]]],0.6), 313 | cex = rob_psize 314 | ) 315 | graphics::text(x_pos[j], rows, syms[dat[[paste0("d", j)]]], cex = tsize) 316 | } 317 | 318 | 319 | graphics::points( 320 | rep(x_overall_pos, length(rows)), 321 | rows, 322 | pch = 15, 323 | col = scales::alpha(cols[dat[["overall"]]],0.6), 324 | cex = rob_psize 325 | ) 326 | graphics::text(x_overall_pos, rows, syms[dat[["overall"]]], cex = tsize) 327 | graphics::par(op) 328 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 329 | # Add sub-group, summary polygons & text 330 | 331 | rma_flexi <- function(x) { 332 | stats::update(res, 333 | subset = (overall == x) 334 | ) 335 | } 336 | 337 | subgroup_res <- purrr::map(unique(dat$overall), rma_flexi) 338 | 339 | if (length(unique(dat$overall))>1) { 340 | 341 | ### add summary polygons for the three subgroups 342 | for (i in 1:nrow(dat_rob_vec)) { 343 | 344 | if (length(subgroup_res[[i]]$slab) == 1) { 345 | next 346 | } 347 | 348 | metafor::addpoly( 349 | subgroup_res[[i]], 350 | # fonts = 4, 351 | row = dat_rob_vec$stats[i], 352 | cex = 1.2, 353 | textpos=textpos, 354 | atransf = exp, 355 | annotate = F, 356 | mlab = mlabfun("RE Model for Subgroup", subgroup_res[[i]]) 357 | ) 358 | 359 | annotate_poly(subgroup_res[[i]]$b, 360 | subgroup_res[[i]]$ci.lb, 361 | subgroup_res[[i]]$ci.ub, 362 | textpos = textpos, 363 | rows = dat_rob_vec$stats[[i]]) 364 | 365 | } 366 | } 367 | 368 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 369 | 370 | if(!is.null(title)){ 371 | graphics::par(font = 2) 372 | graphics::text(x_min, y_max, pos=4, bquote(bold(underline(.(title)))), cex = 1.2) 373 | graphics::par(op) 374 | } 375 | 376 | 377 | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- 378 | 379 | if (length(unique(dat$overall))>1 && nrow(dat)>9) { 380 | 381 | # Fit meta-regression model to test for subgroup differences 382 | subgroup_res <- stats::update(res, mods = ~ overall, method = "DL") 383 | 384 | 385 | ### add text for the test of subgroup differences 386 | graphics::text(x_min,-1.8, pos = 4, cex = 1.2, bquote( 387 | paste( 388 | "Test for Subgroup Differences: ", 389 | Q[M], 390 | " = ", 391 | .(formatC( 392 | subgroup_res$QM, digits = 2, format = "f" 393 | )), 394 | ", df = ", 395 | .(subgroup_res$p - 1), 396 | ", p = ", 397 | .(formatC( 398 | subgroup_res$QMp, digits = 2, format = "f" 399 | )) 400 | ) 401 | )) 402 | } 403 | 404 | 405 | # Add missing evidence 406 | if (!is.null(rob_me)) { 407 | rob_me <- clean_data(rob_me) 408 | 409 | rob_me_colours <- get_colour("ROB2", "cochrane") 410 | 411 | rob_me_cols <- c( 412 | h = rob_me_colours$high_colour, 413 | s = rob_me_colours$concerns_colour, 414 | l = rob_me_colours$low_colour, 415 | n = rob_me_colours$ni_colour, 416 | x = rob_me_colours$na_colour 417 | ) 418 | 419 | rob_me_syms <- c(h = "X", 420 | s = "-", 421 | l = "+", 422 | n = "?", 423 | x = "" 424 | ) 425 | 426 | graphics::text(x_pos[1]-.5,-1,pos=4,cex=1.2,"ROB Missing Evidence: ") 427 | 428 | 429 | graphics::points( 430 | x_overall_pos, 431 | -1, 432 | pch = 15, 433 | col = scales::alpha(rob_me_cols[rob_me],0.6), 434 | cex = rob_psize 435 | ) 436 | graphics::text(x_overall_pos,font = 2, -1, rob_me_syms[rob_me], cex = tsize) 437 | } 438 | 439 | if (rob_legend == TRUE) { 440 | 441 | graphics::legend( 442 | legend_pos, 443 | -1.8, 444 | judgements, 445 | pch = 15, 446 | xjust = 0.5, 447 | col = utils::head(cols,-1), 448 | xpd = TRUE, 449 | title = parse(text = "bold(\"Judgement\")"), 450 | title.adj = 0.1, 451 | cex = rob_legend_cex, 452 | pt.cex = rob_legend_cex, 453 | y.intersp = 0.7 454 | ) 455 | } 456 | 457 | } 458 | -------------------------------------------------------------------------------- /R/rob_save.R: -------------------------------------------------------------------------------- 1 | #' Save risk-of-bias plots to a file using sensible parameters 2 | #' 3 | #' @param rob_object Object created using either rob_summary() or 4 | #' rob_traffic_light() 5 | #' @param file Destination file, with extension (e.g. "rob_figure.png") 6 | #' @param height Height of resulting image, in inches. Defaults to "default" 7 | #' which uses recommended values based on the number of studies included. 8 | #' @param width Width of resulting image, in inches. Defaults to "default" which 9 | #' uses recommended values based on the number of characters in the Study and 10 | #' Domain names. dpi 11 | #' @param dpi Plot resolution. 12 | #' 13 | #' @family helper 14 | #' @export 15 | 16 | rob_save <- function(rob_object, 17 | file = "rob_figure.png", 18 | height = "default", 19 | width = "default", 20 | dpi = 800) { 21 | 22 | check_extension(file) 23 | 24 | width <- ifelse(width == "default", rob_object$rec_width, width) 25 | height <- ifelse(height == "default", rob_object$rec_height, height) 26 | 27 | ggplot2::ggsave( 28 | file, 29 | plot = rob_object, 30 | width = width, 31 | height = height, 32 | units = "in", 33 | dpi = dpi, 34 | limitsize = FALSE 35 | ) 36 | } 37 | -------------------------------------------------------------------------------- /R/rob_tools.R: -------------------------------------------------------------------------------- 1 | #' List the risk-of-bias tools for which templates are available within the package. 2 | #' @description rob_tools() will list the risk-of-bias assessment tools for 3 | #' which templates already exist within the robvis package. If the assessment 4 | #' tool you used does not appear in the list, use the "Generic" template. 5 | #' 6 | #' @param forest Show the tools supported by the forest/blobbogram functions 7 | #' 8 | #' @examples 9 | #' rob_tools() 10 | #' @family helper 11 | #' @export 12 | 13 | rob_tools <- function(forest = FALSE) { 14 | 15 | if (forest) { 16 | tools <- c("ROB2", 17 | "ROBINS-I", 18 | "ROBINS-E") 19 | } else { 20 | tools <- c("ROB2", 21 | "ROB2-Cluster", 22 | "ROBINS-I", 23 | "ROBINS-E", 24 | "QUADAS-2", 25 | "QUIPS", 26 | "Generic" 27 | ) 28 | message( 29 | paste0("Note: the \"ROB2-Cluster\" template is only available ", 30 | "for the rob_traffic_light() function.") 31 | ) 32 | } 33 | 34 | 35 | return(tools) 36 | } 37 | 38 | #' Extract weights from metafor results object and append to risk-of-bias data. 39 | #' 40 | #' @description Used to prepare a risk-of-bias dataset to be passed to the 41 | #' weighted barplot function: rob_summary(..., weighted = TRUE) 42 | #' 43 | #' @param data Risk of bias dataset (without a weight column) 44 | #' @param res metafor results object 45 | #' 46 | #' @family helper 47 | #' 48 | #' @export 49 | #' 50 | #' @examples 51 | #' \donttest{ 52 | #' dat.bcg <- metadat::dat.bcg[c(1:9),] 53 | #' 54 | #' dat <- 55 | #' metafor::escalc( 56 | #' measure = "RR", 57 | #' ai = tpos, 58 | #' bi = tneg, 59 | #' ci = cpos, 60 | #' di = cneg, 61 | #' data = dat.bcg, 62 | #' slab = paste(author, year) 63 | #' ) 64 | #' 65 | #' res <- metafor::rma(yi, vi, data = dat) 66 | #' 67 | #' data_rob2$Study <- paste(dat$author,dat$year) 68 | #' 69 | #' rob_weighted_data <- rob_append_weights(data_rob2[,1:7], res) 70 | #' 71 | #' rob_summary(rob_weighted_data, tool = "ROB2", weighted = TRUE) 72 | #' } 73 | 74 | rob_append_weights <- function(data, res){ 75 | 76 | if (!("rma" %in% class(res))) { 77 | stop("Result objects need to be of class \"meta\" - output from metafor package functions") 78 | } 79 | 80 | # Extract weights 81 | weights <- data.frame(Study = names(stats::weights(res)), 82 | Weight = stats::weights(res), 83 | row.names = NULL) 84 | 85 | # Merge by Study name to create new dataframe 86 | rob_df <- dplyr::left_join(data, weights, by = "Study") 87 | 88 | # Employ check to see if data has merged properly If a merge has failed, one 89 | # of the Weight cells will be NA, meaning the sum will also be NA 90 | if (is.na(sum(rob_df$Weight))) { 91 | stop(paste0("Problem with matching - weights do not equal 100. ", 92 | "Check that the names of studies are the same in the ROB ", 93 | "data and the res object (stored in slab)")) 94 | } 95 | 96 | return(rob_df) 97 | } 98 | 99 | -------------------------------------------------------------------------------- /R/robvis.R: -------------------------------------------------------------------------------- 1 | #' robvis: A package for producing risk-of-bias assessment figures. 2 | #' 3 | #' The robvis package is designed to help users produce publication quality 4 | #' risk-of-bias assessment figures. 5 | #' @docType package 6 | #' @name robvis 7 | #' @keywords internal 8 | 9 | # TODO remove reliance on globalVariables 10 | 11 | globalVariables(c( 12 | "domain", 13 | "Study", 14 | "judgement", 15 | "Weights", 16 | "data.tmp", 17 | ".data", 18 | "dat", 19 | "res", 20 | ".", 21 | "Overall", 22 | "author", 23 | "heading", 24 | "n", 25 | "offset", 26 | "overall", 27 | "result_id", 28 | "row_n", 29 | "study", 30 | "type", 31 | "yi", 32 | "cneg", 33 | "cpos", 34 | "tneg", 35 | "tpos", 36 | "vi", 37 | "year" 38 | )) 39 | -------------------------------------------------------------------------------- /R/utils-pipe.R: -------------------------------------------------------------------------------- 1 | #' Pipe operator 2 | #' 3 | #' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. 4 | #' 5 | #' @name %>% 6 | #' @rdname pipe 7 | #' @keywords internal 8 | #' @export 9 | #' @importFrom magrittr %>% 10 | #' @usage lhs \%>\% rhs 11 | #' @param lhs A value or the magrittr placeholder. 12 | #' @param rhs A function call using the magrittr semantics. 13 | #' @return The result of calling `rhs(lhs)`. 14 | NULL 15 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | 7 | ```{r setup, include = FALSE} 8 | knitr::opts_chunk$set( 9 | collapse = TRUE, 10 | comment = "#>", 11 | fig.path = "man/figures/README-", 12 | out.width = "90%", 13 | fig.width= 12, 14 | fig.height=3) 15 | 16 | fig_count <- 1 17 | ``` 18 | # robvis 19 | 20 | 21 | [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) 22 | [![CRAN Badge.](https://www.r-pkg.org/badges/version-ago/robvis)](https://CRAN.R-project.org/package=robvis) 23 | [![CRAN Downloads.](https://cranlogs.r-pkg.org/badges/last-month/robvis)](https://CRAN.R-project.org/package=robvis) 24 |
25 | [![R build status](https://github.com/mcguinlu/robvis/workflows/R-CMD-check/badge.svg)](https://github.com/mcguinlu/robvis/actions) 26 | [![Codecov test coverage](https://codecov.io/gh/mcguinlu/robvis/branch/master/graph/badge.svg)](https://codecov.io/gh/mcguinlu/robvis?branch=master) 27 |
28 | [![DOI](https://img.shields.io/static/v1.svg?label=Publication&message=10.1002/jrsm.1411&color=informational)](https://doi.org/10.1002/jrsm.1411) 29 | [![metaverse Identifier](https://img.shields.io/static/v1.svg?label=Part%20of%20the&message=metaverse&color=informational)](https://www.github.com/rmetaverse/metaverse) 30 | 31 | 32 | 33 | **UPDATE**: `robvis` now exists as a [web-app](https://mcguinlu.shinyapps.io/robvis), aimed at those who are not familiar with R or who want to explore the package's functionality before installing it locally. 34 | 35 | 36 | ## Description 37 | ```{r include = FALSE} 38 | library(robvis) 39 | ``` 40 | 41 | The `robvis` (Risk-Of-Bias VISualization) package facilitates the rapid production of publication-quality risk-of-bias assessment figures, correctly formatted according to the assessment tool used. 42 | 43 | The motivation for this package is more fully described in the (open access) article introducing the tool, available [here](https://doi.org/10.1002/jrsm.1411). 44 | 45 | ## Getting started 46 | 47 | Install the development version which contains new functionality and a range of bug fixes: 48 | 49 | ```{r, eval=FALSE} 50 | install.packages("devtools") 51 | devtools::install_github("mcguinlu/robvis") 52 | ``` 53 | 54 | To update the package, run the `install_github("mcguinlu/robvis")` command again. 55 | 56 | If you wish to use the older CRAN version of the package, use the following command: 57 | 58 | ```{r, eval=FALSE} 59 | install.packages("robvis") 60 | ``` 61 | 62 | 63 | ### Load data 64 | To load your own data from a .csv file: 65 | 66 | ```{r, eval=FALSE} 67 | mydata <- read.csv("path/to/mydata.csv", header = TRUE) 68 | ``` 69 | 70 | To help users explore `robvis`, we have included example datasets in the package, one for each of the tool templates that currently exist within the package. The `data_rob2` dataset ([view it here](https://github.com/mcguinlu/robvis/blob/master/data_raw/data_rob2.csv)), which contains example risk-of-bias assessments performed using the RoB2.0 tool for randomized controlled trials, is used to create the plots in subsequent sections. 71 | 72 | ### Create plots 73 | 74 | The package contains two plotting functions: 75 | 76 | #### 1. rob_summary() 77 | Returns a ggplot object displaying a bar-chart of the risk of bias of included studies across the domains of the specified tool. [*Note: the defaults used in this function have changed from their original settings, so that a un-weighted barplot is now produced by default. See the NEWS.md file for further information.*] 78 | 79 | ```{r, eval = FALSE} 80 | summary_rob <- rob_summary(data = data_rob2, tool = "ROB2") 81 | 82 | summary_rob 83 | ``` 84 | 85 | ``` {r, echo = FALSE} 86 | plot <- rob_summary(data = data_rob2, tool = "ROB2") 87 | file = paste0("man/figures/robplot",fig_count,".png") 88 | rob_save(plot, file) 89 | fig_count <- fig_count + 1 90 | ``` 91 |
92 | 93 | 94 | 95 | #### 2. rob_traffic_light() 96 | Returns a ggplot object displaying a ["traffic light plot"](https://handbook-5-1.cochrane.org/chapter_8/figure_8_6_c_example_of_a_risk_of_bias_summary_figure.htm), displaying the risk of bias judgment in each domain for each study. 97 | 98 | ```{r, eval=FALSE} 99 | trafficlight_rob <- rob_traffic_light(data = data_rob2, 100 | tool = "ROB2", 101 | psize = 10) 102 | 103 | trafficlight_rob 104 | ``` 105 | 106 | ``` {r, echo = FALSE} 107 | plot <- rob_traffic_light(data = data_rob2, 108 | tool = "ROB2", 109 | psize = 10) 110 | file = paste0("man/figures/robplot",fig_count,".png") 111 | rob_save(plot, file) 112 | fig_count <- fig_count + 1 113 | ``` 114 |
115 | 116 | ### Other functions 117 | 118 | #### rob_save() 119 | Pass the `robvis` to this function, along with a destination file, to save your risk-of-bias plots using sensible defaults. 120 | 121 | ```{r, eval = FALSE} 122 | rob_save(trafficlight_rob, "rob_fig.png") 123 | ``` 124 | 125 | #### rob_tools() 126 | Outputs a list of the risk of bias assessment tools for which a template currently exists in rob_summary(). We expect this list to be updated in the near future to include tools such as ROBIS (tool for assessing risk of bias in systematic reviews). 127 | 128 | ```{r} 129 | rob_tools() 130 | ``` 131 | 132 | ## Advanced usage 133 | ### Change the colour scheme 134 | The `colour` argument of both plotting functions allows users to select from two predefined colour schemes ("cochrane" or "colourblind") or to define their own palette by providing a vector of hex codes. 135 | 136 | For example, to use the predefined "colourblind" palette: 137 | 138 | ```{r, eval=FALSE} 139 | rob_summary(data = data_rob2, 140 | tool = "ROB2", 141 | colour = "colourblind") 142 | 143 | ``` 144 | 145 | ``` {r, echo = FALSE} 146 | plot <- rob_summary(data = data_rob2, 147 | tool = "ROB2", 148 | colour = "colourblind") 149 | file = paste0("man/figures/robplot",fig_count,".png") 150 | rob_save(plot, file) 151 | fig_count <- fig_count + 1 152 | ``` 153 |
154 | 155 | And to define your own colour scheme: 156 | ```{r, eval=FALSE} 157 | rob_summary( 158 | data = data_rob2, 159 | tool = "ROB2", 160 | colour = c("#f442c8", 161 | "#bef441", 162 | "#000000", 163 | "#d16684") 164 | ) 165 | 166 | ``` 167 | 168 | 169 | ``` {r, echo = FALSE} 170 | plot <- rob_summary(data = data_rob2, 171 | tool = "ROB2", 172 | colour = c("#f442c8", 173 | "#bef441", 174 | "#000000", 175 | "#d16684")) 176 | file = paste0("man/figures/robplot",fig_count,".png") 177 | rob_save(plot, file) 178 | fig_count <- fig_count + 1 179 | ``` 180 |
181 | 182 | ### No "Overall" judgement 183 | 184 | By default, both functions include an "Overall" risk of bias domain. To prevent this, remove the overall column from your dataset and set `overall = FALSE`. 185 | 186 | ```{r, eval=FALSE} 187 | summary_rob <- rob_summary(data = data_rob2[1:6], tool = "ROB2", overall = FALSE) 188 | summary_rob 189 | ``` 190 | 191 | ``` {r, echo = FALSE} 192 | plot <- rob_summary(data = data_rob2[1:6], tool = "ROB2", overall = FALSE) 193 | file = paste0("man/figures/robplot",fig_count,".png") 194 | rob_save(plot, file) 195 | fig_count <- fig_count + 1 196 | ``` 197 |
198 | 199 | ```{r, eval=FALSE} 200 | rob_traffic_light(data = data_rob2[1:6], 201 | tool = "ROB2", 202 | overall = FALSE) 203 | ``` 204 | 205 | ``` {r, echo = FALSE} 206 | plot <- rob_traffic_light(data = data_rob2[1:6], 207 | tool = "ROB2", 208 | overall = FALSE) 209 | file = paste0("man/figures/robplot",fig_count,".png") 210 | rob_save(plot, file) 211 | fig_count <- fig_count + 1 212 | ``` 213 |
214 | 215 | ### Editing the plots 216 | Finally, because the output (`summary_rob` and `trafficlight_rob` in the examples above) is a ggplot2 object, it is easy to adjust the plot to your own preferences. 217 | 218 | For example, to add a title: 219 | ```{r, eval=FALSE} 220 | library(ggplot2) 221 | 222 | rob_summary(data = data_rob2, tool = "ROB2") + 223 | ggtitle("Summary of RoB 2.0 assessments") 224 | ``` 225 | 226 | ``` {r, echo = FALSE} 227 | plot <- rob_summary(data = data_rob2, tool = "ROB2") + 228 | ggplot2::ggtitle("Summary of RoB2.0 assessments") 229 | file = paste0("man/figures/robplot",fig_count,".png") 230 | rob_save(plot, file) 231 | fig_count <- fig_count + 1 232 | ``` 233 |
234 | 235 | ## Examples of `robvis` in published papers 236 | 237 | To date, `robvis` has been cited in more than 1500 academic articles - these can be explored [here](https://scholar.google.com/scholar?cites=12564214960529060925&as_sdt=2005&sciodt=0,5&hl=en). 238 | 239 | ## Code of conduct 240 | 241 | Please note that the 'robvis' project is released with a 242 | [Contributor Code of Conduct](https://github.com/mcguinlu/robvis/blob/master/CODE_OF_CONDUCT.md). 243 | By contributing to this project, you agree to abide by its terms. 244 | 245 | ## License 246 | 247 | This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/mcguinlu/robvis/blob/master/LICENSE) file for details. 248 | 249 | ## Acknowledgments 250 | 251 | * The `rob_summary()` function was based on code forwarded by a colleague. I recently discovered that this code was adapted from that presented in the wonderful "[Doing Meta-Analysis in R](https://bookdown.org/MathiasHarrer/Doing_Meta_Analysis_in_R/plotting-the-summary.html)" guide, so I would like to acknowledge the authors here. 252 | * [Emily Kothe](https://github.com/ekothe) for help in fixing `ggplot2` coding issues. 253 | * [Eliza Grames](https://github.com/elizagrames) for creating the `robvis` hex sticker. 254 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # robvis 5 | 6 | [![Project Status: Active – The project has reached a stable, usable 7 | state and is being actively 8 | developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) 9 | [![CRAN 10 | Badge.](https://www.r-pkg.org/badges/version-ago/robvis)](https://CRAN.R-project.org/package=robvis) 11 | [![CRAN 12 | Downloads.](https://cranlogs.r-pkg.org/badges/last-month/robvis)](https://CRAN.R-project.org/package=robvis) 13 |
[![R build 14 | status](https://github.com/mcguinlu/robvis/workflows/R-CMD-check/badge.svg)](https://github.com/mcguinlu/robvis/actions) 15 | [![Codecov test 16 | coverage](https://codecov.io/gh/mcguinlu/robvis/branch/master/graph/badge.svg)](https://codecov.io/gh/mcguinlu/robvis?branch=master) 17 |
18 | [![DOI](https://img.shields.io/static/v1.svg?label=Publication&message=10.1002/jrsm.1411&color=informational)](https://doi.org/10.1002/jrsm.1411) 19 | [![metaverse 20 | Identifier](https://img.shields.io/static/v1.svg?label=Part%20of%20the&message=metaverse&color=informational)](https://www.github.com/rmetaverse/metaverse) 21 | 22 | **UPDATE**: `robvis` now exists as a 23 | [web-app](https://mcguinlu.shinyapps.io/robvis), aimed at those who are 24 | not familiar with R or who want to explore the package’s functionality 25 | before installing it locally. 26 | 27 | ## Description 28 | 29 | The `robvis` (Risk-Of-Bias VISualization) package facilitates the rapid 30 | production of publication-quality risk-of-bias assessment figures, 31 | correctly formatted according to the assessment tool used. 32 | 33 | The motivation for this package is more fully described in the (open 34 | access) article introducing the tool, available 35 | [here](https://doi.org/10.1002/jrsm.1411). 36 | 37 | ## Getting started 38 | 39 | Install the development version which contains new functionality and a 40 | range of bug fixes: 41 | 42 | ``` r 43 | install.packages("devtools") 44 | devtools::install_github("mcguinlu/robvis") 45 | ``` 46 | 47 | To update the package, run the `install_github("mcguinlu/robvis")` 48 | command again. 49 | 50 | If you wish to use the older CRAN version of the package, use the 51 | following command: 52 | 53 | ``` r 54 | install.packages("robvis") 55 | ``` 56 | 57 | ### Load data 58 | 59 | To load your own data from a .csv file: 60 | 61 | ``` r 62 | mydata <- read.csv("path/to/mydata.csv", header = TRUE) 63 | ``` 64 | 65 | To help users explore `robvis`, we have included example datasets in the 66 | package, one for each of the tool templates that currently exist within 67 | the package. The `data_rob2` dataset ([view it 68 | here](https://github.com/mcguinlu/robvis/blob/master/data_raw/data_rob2.csv)), 69 | which contains example risk-of-bias assessments performed using the 70 | RoB2.0 tool for randomized controlled trials, is used to create the 71 | plots in subsequent sections. 72 | 73 | ### Create plots 74 | 75 | The package contains two plotting functions: 76 | 77 | #### 1. rob_summary() 78 | 79 | Returns a ggplot object displaying a bar-chart of the risk of bias of 80 | included studies across the domains of the specified tool. \[*Note: the 81 | defaults used in this function have changed from their original 82 | settings, so that a un-weighted barplot is now produced by default. See 83 | the NEWS.md file for further information.*\] 84 | 85 | ``` r 86 | summary_rob <- rob_summary(data = data_rob2, tool = "ROB2") 87 | 88 | summary_rob 89 | ``` 90 | 91 |
92 | 93 | 94 | 95 |
96 | 97 | #### 2. rob_traffic_light() 98 | 99 | Returns a ggplot object displaying a [“traffic light 100 | plot”](https://handbook-5-1.cochrane.org/chapter_8/figure_8_6_c_example_of_a_risk_of_bias_summary_figure.htm), 101 | displaying the risk of bias judgment in each domain for each study. 102 | 103 | ``` r 104 | trafficlight_rob <- rob_traffic_light(data = data_rob2, 105 | tool = "ROB2", 106 | psize = 10) 107 | 108 | trafficlight_rob 109 | ``` 110 | 111 |
112 | 113 | 114 | 115 |
116 | 117 | ### Other functions 118 | 119 | #### rob_save() 120 | 121 | Pass the `robvis` to this function, along with a destination file, to 122 | save your risk-of-bias plots using sensible defaults. 123 | 124 | ``` r 125 | rob_save(trafficlight_rob, "rob_fig.png") 126 | ``` 127 | 128 | #### rob_tools() 129 | 130 | Outputs a list of the risk of bias assessment tools for which a template 131 | currently exists in rob_summary(). We expect this list to be updated in 132 | the near future to include tools such as ROBIS (tool for assessing risk 133 | of bias in systematic reviews). 134 | 135 | ``` r 136 | rob_tools() 137 | #> Note: the "ROB2-Cluster" template is only available for the rob_traffic_light() function. 138 | #> [1] "ROB2" "ROB2-Cluster" "ROBINS-I" "ROBINS-E" "QUADAS-2" 139 | #> [6] "QUIPS" "Generic" 140 | ``` 141 | 142 | ## Advanced usage 143 | 144 | ### Change the colour scheme 145 | 146 | The `colour` argument of both plotting functions allows users to select 147 | from two predefined colour schemes (“cochrane” or “colourblind”) or to 148 | define their own palette by providing a vector of hex codes. 149 | 150 | For example, to use the predefined “colourblind” palette: 151 | 152 | ``` r 153 | rob_summary(data = data_rob2, 154 | tool = "ROB2", 155 | colour = "colourblind") 156 | ``` 157 | 158 |
159 | 160 | 161 | 162 |
163 | 164 | And to define your own colour scheme: 165 | 166 | ``` r 167 | rob_summary( 168 | data = data_rob2, 169 | tool = "ROB2", 170 | colour = c("#f442c8", 171 | "#bef441", 172 | "#000000", 173 | "#d16684") 174 | ) 175 | ``` 176 | 177 |
178 | 179 | 180 | 181 |
182 | 183 | ### No “Overall” judgement 184 | 185 | By default, both functions include an “Overall” risk of bias domain. To 186 | prevent this, remove the overall column from your dataset and set 187 | `overall = FALSE`. 188 | 189 | ``` r 190 | summary_rob <- rob_summary(data = data_rob2[1:6], tool = "ROB2", overall = FALSE) 191 | summary_rob 192 | ``` 193 | 194 |
195 | 196 | 197 | 198 |
199 | 200 | ``` r 201 | rob_traffic_light(data = data_rob2[1:6], 202 | tool = "ROB2", 203 | overall = FALSE) 204 | ``` 205 | 206 |
207 | 208 | 209 | 210 |
211 | 212 | ### Editing the plots 213 | 214 | Finally, because the output (`summary_rob` and `trafficlight_rob` in the 215 | examples above) is a ggplot2 object, it is easy to adjust the plot to 216 | your own preferences. 217 | 218 | For example, to add a title: 219 | 220 | ``` r 221 | library(ggplot2) 222 | 223 | rob_summary(data = data_rob2, tool = "ROB2") + 224 | ggtitle("Summary of RoB 2.0 assessments") 225 | ``` 226 | 227 |
228 | 229 | 230 | 231 |
232 | 233 | ## Examples of `robvis` in published papers 234 | 235 | To date, `robvis` has been cited in more than 1500 academic articles - 236 | these can be explored 237 | [here](https://scholar.google.com/scholar?cites=12564214960529060925&as_sdt=2005&sciodt=0,5&hl=en). 238 | 239 | ## Code of conduct 240 | 241 | Please note that the ‘robvis’ project is released with a [Contributor 242 | Code of 243 | Conduct](https://github.com/mcguinlu/robvis/blob/master/CODE_OF_CONDUCT.md). 244 | By contributing to this project, you agree to abide by its terms. 245 | 246 | ## License 247 | 248 | This project is licensed under the MIT License - see the 249 | [LICENSE.md](https://github.com/mcguinlu/robvis/blob/master/LICENSE) 250 | file for details. 251 | 252 | ## Acknowledgments 253 | 254 | - The `rob_summary()` function was based on code forwarded by a 255 | colleague. I recently discovered that this code was adapted from that 256 | presented in the wonderful “[Doing Meta-Analysis in 257 | R](https://bookdown.org/MathiasHarrer/Doing_Meta_Analysis_in_R/plotting-the-summary.html)” 258 | guide, so I would like to acknowledge the authors here. 259 | - [Emily Kothe](https://github.com/ekothe) for help in fixing `ggplot2` 260 | coding issues. 261 | - [Eliza Grames](https://github.com/elizagrames) for creating the 262 | `robvis` hex sticker. 263 | -------------------------------------------------------------------------------- /RSM-paper/ama.csl: -------------------------------------------------------------------------------- 1 | 2 | 249 | -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript V1.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript V1.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript V2.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript V2.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript V3.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript V3.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript V4.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript V4.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript v11 JPTH.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript v11 JPTH.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript v11.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript v11.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript v12.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript v12.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript v13.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript v13.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript v5.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript v5.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript v6.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript v6.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript v7.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript v7.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/manuscript v8.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/manuscript v8.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/robvis manuscript - RSM Revision Submitted.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/robvis manuscript - RSM Revision Submitted.docx -------------------------------------------------------------------------------- /RSM-paper/manuscript versions/robvis manuscript - RSM Submitted.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/manuscript versions/robvis manuscript - RSM Submitted.docx -------------------------------------------------------------------------------- /RSM-paper/reviewer-comments/robvis_reviewer_comments v2.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/reviewer-comments/robvis_reviewer_comments v2.docx -------------------------------------------------------------------------------- /RSM-paper/reviewer-comments/robvis_reviewer_comments.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/reviewer-comments/robvis_reviewer_comments.docx -------------------------------------------------------------------------------- /RSM-paper/submitted/Cover letter.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/submitted/Cover letter.docx -------------------------------------------------------------------------------- /RSM-paper/submitted/RSM robvis Manuscript - Submitted Version - Initial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/submitted/RSM robvis Manuscript - Submitted Version - Initial.pdf -------------------------------------------------------------------------------- /RSM-paper/submitted/RSM robvis manuscript - Submitted Version - Revision.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/submitted/RSM robvis manuscript - Submitted Version - Revision.pdf -------------------------------------------------------------------------------- /RSM-paper/word-styles-reference-01.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/RSM-paper/word-styles-reference-01.docx -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | destination: docs 2 | 3 | reference: 4 | - title: Creating risk-of-bias figures 5 | contents: 6 | - rob_traffic_light 7 | - rob_summary 8 | - rob_forest 9 | - title: Helper functions 10 | contents: 11 | - rob_dummy 12 | - rob_save 13 | - rob_tools 14 | - rob_append_weights 15 | 16 | navbar: 17 | title: "metafor" 18 | left: 19 | - icon: fa-home fa-lg 20 | href: index.html 21 | - text: "Functions" 22 | href: reference/index.html 23 | - text: Tutorials 24 | menu: 25 | - text: Introduction 26 | href: articles/Introduction_to_robvis.html 27 | - text: Working with metafor 28 | href: articles/metafor.html 29 | - text: "RSM Article" 30 | href: https://onlinelibrary.wiley.com/doi/pdf/10.1002/jrsm.1411 31 | - text: "Changelog" 32 | href: news/index.html 33 | right: 34 | - icon: fa-twitter 35 | href: https://twitter.com/mcguinlu 36 | - icon: fa-github 37 | href: https://github.com/mcguinlu/robvis 38 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | 3 | coverage: 4 | status: 5 | project: 6 | default: 7 | target: auto 8 | threshold: 1% 9 | patch: 10 | default: 11 | target: auto 12 | threshold: 1% 13 | -------------------------------------------------------------------------------- /data/data_bias_direction.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/data/data_bias_direction.rda -------------------------------------------------------------------------------- /data/data_quadas.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/data/data_quadas.rda -------------------------------------------------------------------------------- /data/data_quips.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/data/data_quips.rda -------------------------------------------------------------------------------- /data/data_rob1.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/data/data_rob1.rda -------------------------------------------------------------------------------- /data/data_rob2.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/data/data_rob2.rda -------------------------------------------------------------------------------- /data/data_rob2_cluster.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/data/data_rob2_cluster.rda -------------------------------------------------------------------------------- /data/data_robins_e.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/data/data_robins_e.rda -------------------------------------------------------------------------------- /data/data_robins_i.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/data/data_robins_i.rda -------------------------------------------------------------------------------- /data_raw/bias_direction.csv: -------------------------------------------------------------------------------- 1 | "","X","result_id","study","type","yi","vi","d1j","d1t","d1d","d2j","d2t","d2d","d3j","d3t","d3d","d4j","d4t","d4d","d5j","d5t","d5d","d6j","d6t","d6d","d7j","d7t","d7d","overall" 2 | "1",1,1,"Study 1","NRSI",-0.127833372,0.125065861815403,"High","Add","Favours comparator","Low","None","None","Moderate","Prop","Unpredictable","Low","None","None","Low","None","None","Low","None","None","Moderate","Prop","Away from null","Moderate" 3 | "2",2,2,"Study 2","NRSI",-0.198450939,0.0868091857062482,"Moderate","Add","Favours experimental","Moderate","Add","Favours comparator","Low","None","None","Low","None","None","Low","None","None","Moderate","Add","Unpredictable","Moderate","Prop","Away from null","Moderate" 4 | "3",3,3,"Study 3","NRSI",-0.186329578,0.0336124035013122,"High","Add","Favours comparator","High","Add","Favours comparator","Low","None","None","Low","None","None","Low","None","None","Moderate","Add","Unpredictable","Moderate","Prop","Away from null","Moderate" 5 | "4",4,4,"Study 4","NRSI",0.19062036,0.0552657833167771,"High","Add","Favours comparator","Moderate","Add","Unpredictable","Low","None","None","Low","None","None","Low","None","None","Low","None","None","Moderate","Prop","Away from null","High" 6 | "5",5,5,"Study 5","NRSI",-0.562118918,0.0514192363691262,"High","Add","Favours comparator","Low","None","None","Low","None","None","Low","None","None","Moderate","Prop","Unpredictable","Low","None","None","Moderate","Prop","Away from null","Low" 7 | "6",6,6,"Study 6","NRSI",-0.094310679,0.0696982192016652,"High","Add","Favours comparator","Moderate","Add","Favours comparator","Low","None","None","Low","None","None","Moderate","Prop","Unpredictable","Low","None","None","Moderate","Prop","Away from null","Low" 8 | "7",7,7,"Study 7","NRSI",-0.776528789,0.057107497776006,"Moderate","Add","Favours experimental","Low","None","None","Moderate","Prop","Unpredictable","Low","None","None","High","Prop","Unpredictable","Low","None","None","Moderate","Prop","Away from null","Moderate" 9 | "8",8,8,"Study 8","NRSE",-0.061875404,0.0160767067709541,"Moderate","Add","Favours comparator","Low","None","None","Low","None","None","Low","None","None","Moderate","Prop","Unpredictable","Low","None","None","Moderate","Prop","Away from null","Moderate" 10 | "9",9,9,"Study 9","NRSE",0.019802627,0.0225955798907006,"Moderate","Add","Favours comparator","Low","None","None","Low","None","None","Low","None","None","Moderate","Prop","Unpredictable","Low","None","None","Moderate","Prop","Away from null","Moderate" 11 | "10",10,10,"Study 10","NRSE",-0.105360516,0.0327033580531272,"Moderate","Add","Favours comparator","Low","None","None","Low","None","None","Low","None","None","Moderate","Prop","Unpredictable","Low","None","None","Moderate","Prop","Away from null","Moderate" 12 | "11",11,11,"Study 11","MR",0.067658648,0.00204355793442144,"Moderate","Prop","Unpredictable","Low","None","None","Low","None","None","Low","None","None","Low","None","None",NA,"None","None",NA,"None","None","Low" 13 | "12",12,12,"Study 12","NRSI",-0.478035801,0.0510657988694049,"High","Add","Favours comparator","Moderate","Add","Favours comparator","Low","None","None","Low","None","None","Moderate","Prop","Unpredictable","Low","None","None","Moderate","Prop","Away from null","High" 14 | "13",13,13,"Study 13","NRSE",0.113328685,0.00204930282263908,"High","Add","Favours experimental","Moderate","Add","Unpredictable","Low","None","None","Low","None","None","Low","None","None","Low","None","None","Moderate","Prop","Away from null","Low" 15 | "14",14,14,"Study 14","NRSI",0.173953307,0.296639007153852,"High","Add","Favours comparator","Moderate","Add","Unpredictable","Low","None","None","Low","None","None","High","Prop","Unpredictable","Low","None","None","Moderate","Prop","Away from null","Moderate" 16 | "15",15,15,"Study 15","NRSI",-0.210721031,0.0668399873789016,"Moderate","Add","Favours comparator","Low","None","None","Low","None","None","Low","None","None","Low","None","None","Moderate","Add","Unpredictable","Moderate","Prop","Away from null","Low" 17 | "16",16,16,"Study 16","NRSE",-0.116533816,0.0312664652770276,"High","Add","Favours comparator","Low","None","None","Low","None","None","Low","None","None","Low","None","None","Low","None","None","Moderate","Prop","Away from null","Moderate" 18 | "17",17,17,"Study 17","MR",-0.204,0.053824,"Moderate","Prop","Towards null","Moderate","Add","Unpredictable","Low","None","None","Moderate","Add","Unpredictable","Moderate","Prop","Unpredictable",NA,"None","None",NA,"None","None","Low" 19 | "18",18,18,"Study 18","NRSI",0.157003749,0.0369749537621256,"Moderate","Add","Favours comparator","Moderate","Add","Unpredictable","Low","None","None","Low","None","None","Low","None","None","Low","None","None","Moderate","Prop","Away from null","High" 20 | "19",19,19,"Study 19","NRSI",0.086177696,0.0607008135803732,"Moderate","Add","Favours comparator","Moderate","Add","Unpredictable","Low","None","None","Low","None","None","Low","None","None","Low","None","None","Moderate","Prop","Away from null","Moderate" 21 | "20",20,20,"Study 20","RCT",-0.527,0.190969,"Low","None","None","Low","None","None","Low","None","None","Moderate","Add","Unpredictable","Moderate","Add","Unpredictable",NA,"None","None",NA,"None","None","Low" 22 | -------------------------------------------------------------------------------- /data_raw/data_quadas.csv: -------------------------------------------------------------------------------- 1 | Study,D1,D2,D3,D4,Overall 2 | Study 1,Low,Low,Low,Low,Low 3 | Study 2,Some concerns,Low,Low,Low,Some concerns 4 | Study 3,Some concerns,Low,Some concerns,Low,Some concerns 5 | Study 4,Low,Low,High,Low,High 6 | Study 5,High,High,Low,Low,High 7 | Study 6,Low,High,Some concerns,Low,High 8 | Study 7,Low,Some concerns,Some concerns,High,High 9 | Study 8,Low,Some concerns,Low,Low,Some concerns 10 | Study 9,Low,Low,High,Low,High 11 | Study 10,Some concerns,Low,Low,No information,Some concerns 12 | Study 11,Some concerns,High,Some concerns,Some concerns,Some concerns 13 | Study 12,Low,Low,Low,Low,Low 14 | -------------------------------------------------------------------------------- /data_raw/data_quips.csv: -------------------------------------------------------------------------------- 1 | Study,D1,D2,D3,D4,D5,D6,Overall 2 | Study 1,Low,Low,Low,Low,Low,Low,Low 3 | Study 2,Moderate,Low,Low,Low,Low,Low,Moderate 4 | Study 3,Moderate,Low,Moderate,Low,Low,Low,Moderate 5 | Study 4,Low,Low,High,Low,Low,Low,High 6 | Study 5,High,High,Low,Low,Low,Low,High 7 | Study 6,Low,High,Moderate,Low,Low,Low,High 8 | Study 7,Low,Moderate,Moderate,Low,Low,High,High 9 | Study 8,Low,Moderate,Low,Low,Low,Low,Moderate 10 | Study 9,Low,Low,High,Low,Low,Low,High 11 | Study 10,Moderate,Low,Low,Low,Low,No information,Moderate 12 | Study 11,Moderate,High,Low,Low,Moderate,Moderate,Moderate 13 | Study 12,Low,Low,Low,Low,Low,Low,Low 14 | -------------------------------------------------------------------------------- /data_raw/data_rob1.csv: -------------------------------------------------------------------------------- 1 | Study,Random.sequence.generation,Allocation.concealment,Blinding.of.participants.and.personnel,Blinding.of.outcome.assessment,Incomplete.outcome.data,Selective.reporting,Other.sources.of.bias,Overall 2 | Study 1,Low,Low,Low,Low,Low,Low,Low,Low 3 | Study 2,Unclear,Low,Low,Low,Low,Low,Unclear,Unclear 4 | Study 3,Unclear,Low,Low,Unclear,Low,Low,Low,Unclear 5 | Study 4,Low,Low,Low,High,Low,Unclear,High,High 6 | Study 5,High,High,High,Low,Low,Unclear,Unclear,High 7 | Study 6,Low,High,High,Unclear,Low,Low,Unclear,High 8 | Study 7,Low,Unclear,Unclear,Unclear,High,Low,No information,High 9 | Study 8,Low,Unclear,Unclear,Low,Low,Low,Low,Unclear 10 | Study 9,Low,Low,Low,High,Low,Low,Low,High 11 | -------------------------------------------------------------------------------- /data_raw/data_rob2.csv: -------------------------------------------------------------------------------- 1 | Study,D1,D2,D3,D4,D5,Overall 2 | Study 1,Low,Low,Low,Low,Low,Low 3 | Study 2,Some concerns,Low,Low,Low,Low,Some concerns 4 | Study 3,No information,Low,Some concerns,Low,Low,Some concerns 5 | Study 4,Low,Low,High,Low,Some concerns,High 6 | Study 5,High,High,Low,Low,Some concerns,High 7 | Study 6,Low,High,Some concerns,Low,Low,High 8 | Study 7,Low,Some concerns,Some concerns,High,Low,High 9 | Study 8,Low,Some concerns,Low,Low,Low,Some concerns 10 | Study 9,Low,Low,High,Low,Low,High 11 | -------------------------------------------------------------------------------- /data_raw/data_rob2_cluster.csv: -------------------------------------------------------------------------------- 1 | Study,D1,D1b,D2,D3,D4,D5,Overall 2 | Study 1,Low,Not applicable,Low,Low,Low,Low,Low 3 | Study 2,Some concerns,Not applicable,Low,Low,Low,Low,Some concerns 4 | Study 3,Some concerns,Not applicable,Low,Some concerns,Low,Low,Some concerns 5 | Study 4,Low,Not applicable,Low,High,Low,Some concerns,High 6 | Study 5,High,High,High,Low,Low,Some concerns,High 7 | Study 6,Low,High,High,Some concerns,Low,Low,High 8 | Study 7,Low,Some concerns,Some concerns,Some concerns,High,Low,High 9 | Study 8,Low,Not applicable,Some concerns,Low,Low,Low,Some concerns 10 | Study 9,Low,Not applicable,Low,High,Low,No information,High 11 | -------------------------------------------------------------------------------- /data_raw/data_robins_e.csv: -------------------------------------------------------------------------------- 1 | Study,D1,D2,D3,D4,D5,D6,D7,Overall 2 | Study 1,Some concerns,Low,Low,Some concerns,Low,Some concerns,Some concerns,Some concerns 3 | Study 2,Some concerns,Some concerns,Some concerns,Low,Some concerns,Some concerns,Low,Some concerns 4 | Study 3,Some concerns,Very high,Very high,High,Some concerns,Some concerns,High,Very high 5 | Study 4,Some concerns,Some concerns,Low,Low,Some concerns,Some concerns,Low,Some concerns 6 | Study 5,No information,Some concerns,Low,Very high,Low,Low,High,Very high 7 | Study 6,High,Low,Low,High,Some concerns,Low,High,High 8 | Study 7,Some concerns,High,Low,Some concerns,Some concerns,Some concerns,Some concerns,High 9 | Study 8,Some concerns,Low,High,High,Low,Some concerns,Low,High 10 | Study 9,High,Some concerns,Low,High,Low,Low,Some concerns,High 11 | Study 10,High,Low,Some concerns,Some concerns,Some concerns,Low,Some concerns,High 12 | -------------------------------------------------------------------------------- /data_raw/data_robins_i.csv: -------------------------------------------------------------------------------- 1 | Study,D1,D2,D3,D4,D5,D6,D7,Overall 2 | Study 1,Moderate,Critical,Low,Low,Moderate,Moderate,Moderate,Critical 3 | Study 2,Moderate,No information,Moderate,Low,Low,Low,Moderate,Moderate 4 | Study 3,Moderate,Serious,Low,Serious,Low,Low,Low,Serious 5 | Study 4,Serious,Moderate,Low,Low,Moderate,Moderate,Low,Serious 6 | Study 5,Moderate,Critical,Low,Low,Moderate,Moderate,Moderate,Critical 7 | Study 6,Moderate,Moderate,Low,Moderate,Moderate,Serious,Moderate,Serious 8 | Study 7,Moderate,Serious,Low,Low,Serious,Moderate,Low,Serious 9 | Study 8,Moderate,Low,Serious,Moderate,Low,Serious,Moderate,Serious 10 | Study 9,Moderate,Serious,Low,Low,Low,Low,Moderate,Serious 11 | Study 10,Serious,Low,Low,Low,Serious,Moderate,Serious,Serious 12 | -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | citHeader("To cite robvis in publications, please use:") 2 | 3 | citEntry( 4 | entry = "Article", 5 | title = "Risk-of-bias VISualization (robvis): An R package and Shiny web app for visualizing risk-of-bias assessments", 6 | author = "Luke A McGuinness and Julian PT Higgins", 7 | year = "2020", 8 | journal = "Research Synthesis Methods", 9 | url = "https://github.com/mcguinlu/robvis", 10 | doi = "10.1002/jrsm.1411", 11 | textVersion = paste( 12 | "Luke A McGuinness and Julian PT Higgins (2020).", 13 | "Risk-of-bias VISualization (robvis): An R package and Shiny web app for visualizing risk-of-bias assessments", 14 | "Research Synthesis Methods. https://doi.org/10.1002/jrsm.1411" 15 | ) 16 | ) 17 | 18 | citFooter("If you make use of the forest plot functions, which build on the {metafor} package, please also cite: \n\n") 19 | 20 | citFooter( 21 | "- Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1-48. https://doi.org/10.18637/jss.v036.i03" 22 | ) 23 | 24 | -------------------------------------------------------------------------------- /inst/WORDLIST: -------------------------------------------------------------------------------- 1 | Cochrane 2 | Codecov 3 | Colour 4 | DOI 5 | Grames 6 | QUADAS 7 | ROBIS 8 | RoB 9 | VISualization 10 | al 11 | behaviour 12 | blobbogram 13 | bmj 14 | bolds 15 | cochrane 16 | colour 17 | colourblind 18 | colours 19 | csv 20 | customisation 21 | dat 22 | doi 23 | endeavour 24 | et 25 | ggplot 26 | judgement 27 | judgements 28 | loq 29 | magrittr 30 | md 31 | metafor 32 | metaverse 33 | png 34 | randomised 35 | repo 36 | robvis’ 37 | sei 38 | shortcodes 39 | specialised 40 | un 41 | -------------------------------------------------------------------------------- /man/data_bias_direction.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_data.R 3 | \docType{data} 4 | \name{data_bias_direction} 5 | \alias{data_bias_direction} 6 | \title{Example directional risk-of-bias dataset} 7 | \format{ 8 | A data frame with 20 rows and 27 variables: 9 | \describe{ 10 | \item{\code{result_id}}{integer COLUMN_DESCRIPTION} 11 | \item{\code{study}}{character COLUMN_DESCRIPTION} 12 | \item{\code{type}}{character COLUMN_DESCRIPTION} 13 | \item{\code{yi}}{double COLUMN_DESCRIPTION} 14 | \item{\code{vi}}{double COLUMN_DESCRIPTION} 15 | \item{\code{d1j}}{character COLUMN_DESCRIPTION} 16 | \item{\code{d1t}}{character COLUMN_DESCRIPTION} 17 | \item{\code{d1d}}{character COLUMN_DESCRIPTION} 18 | \item{\code{d2j}}{character COLUMN_DESCRIPTION} 19 | \item{\code{d2t}}{character COLUMN_DESCRIPTION} 20 | \item{\code{d2d}}{character COLUMN_DESCRIPTION} 21 | \item{\code{d3j}}{character COLUMN_DESCRIPTION} 22 | \item{\code{d3t}}{character COLUMN_DESCRIPTION} 23 | \item{\code{d3d}}{character COLUMN_DESCRIPTION} 24 | \item{\code{d4j}}{character COLUMN_DESCRIPTION} 25 | \item{\code{d4t}}{character COLUMN_DESCRIPTION} 26 | \item{\code{d4d}}{character COLUMN_DESCRIPTION} 27 | \item{\code{d5j}}{character COLUMN_DESCRIPTION} 28 | \item{\code{d5t}}{character COLUMN_DESCRIPTION} 29 | \item{\code{d5d}}{character COLUMN_DESCRIPTION} 30 | \item{\code{d6j}}{character COLUMN_DESCRIPTION} 31 | \item{\code{d6t}}{character COLUMN_DESCRIPTION} 32 | \item{\code{d6d}}{character COLUMN_DESCRIPTION} 33 | \item{\code{d7j}}{character COLUMN_DESCRIPTION} 34 | \item{\code{d7t}}{character COLUMN_DESCRIPTION} 35 | \item{\code{d7d}}{character COLUMN_DESCRIPTION} 36 | \item{\code{overall}}{character COLUMN_DESCRIPTION} 37 | } 38 | } 39 | \source{ 40 | {Created for this package} 41 | } 42 | \usage{ 43 | data_bias_direction 44 | } 45 | \description{ 46 | This dataset is include to support experimental aspects of the 47 | package. 48 | } 49 | \keyword{internal} 50 | -------------------------------------------------------------------------------- /man/data_quadas.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_data.R 3 | \docType{data} 4 | \name{data_quadas} 5 | \alias{data_quadas} 6 | \title{Example QUADAS-2 assessment dataset} 7 | \format{ 8 | A data frame with the following 6 columns: 9 | \describe{ 10 | \item{Study}{Study identifier} 11 | \item{D1}{Domain 1 - Patient Selection} 12 | \item{D2}{Domain 2 - Index Test} 13 | \item{D3}{Domain 3 - Reference Standard} 14 | \item{D4}{Domain 4 - Flow & Timing} 15 | \item{Overall}{Overall risk of bias} 16 | } 17 | } 18 | \source{ 19 | {Created for this package} 20 | } 21 | \usage{ 22 | data_quadas 23 | } 24 | \description{ 25 | A data frame containing 12 example assessments performed using 26 | the risk-of-bias portion of the QUADAS-2 tool for the assessment of 27 | diagnostic accuracy studies. 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/data_quips.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_data.R 3 | \docType{data} 4 | \name{data_quips} 5 | \alias{data_quips} 6 | \title{Example QUIPS assessment dataset} 7 | \format{ 8 | A data frame with the following 8 columns: 9 | \describe{ 10 | \item{Study}{Study identifier} 11 | \item{D1}{Domain 1 - Bias due to participation} 12 | \item{D2}{Domain 2 - Bias due to attrition} 13 | \item{D3}{Domain 3 - Bias due to prognostic factor measurement} 14 | \item{D4}{Domain 4 - Bias due to outcome measurement} 15 | \item{D5}{Domain 5 - Bias due to confounding} 16 | \item{D6}{Domain 6 - Bias in statistical analysis and reporting} 17 | \item{Overall}{Overall risk of bias} 18 | } 19 | } 20 | \source{ 21 | {Created for this package} 22 | } 23 | \usage{ 24 | data_quips 25 | } 26 | \description{ 27 | A data frame containing 12 example assessments performed using 28 | the QUIPS (Quality In Prognosis Studies) tool. 29 | } 30 | \keyword{internal} 31 | -------------------------------------------------------------------------------- /man/data_rob1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_data.R 3 | \docType{data} 4 | \name{data_rob1} 5 | \alias{data_rob1} 6 | \title{Example ROB1 assessment dataset} 7 | \format{ 8 | A data frame with the following 9 columns: 9 | \describe{ 10 | \item{Study}{Study identifier} 11 | \item{Random.sequence.generation}{Domain 1} 12 | \item{Allocation.concealment}{Domain 2} 13 | \item{Blinding.of.participants.and.personnel}{Domain 3} 14 | \item{Blinding.of.outcome.assessment}{Domain 4} 15 | \item{Incomplete.outcome.data}{Domain 5} 16 | \item{Selective.reporting}{Domain 6} 17 | \item{Other.sources.of.bias}{Domain 7} 18 | \item{Overall}{Overall risk of bias} 19 | } 20 | } 21 | \source{ 22 | {Created for this package} 23 | } 24 | \usage{ 25 | data_rob1 26 | } 27 | \description{ 28 | A data frame containing 9 example assessments performed using 29 | the RoB1 assessment tool. Note that this dataset is distinct from other 30 | example datasets included in this package, in that the column names are the 31 | full domain names, rather than domain shortcodes (e.g. D1, D2, etc.). This 32 | is because the "Generic" (formerly "RoB1") template offered by 33 | \code{robvis} allows users to create custom risk-of-bias plots, and uses 34 | the column names of the provided dataset to define the domain names for 35 | these custom plots. 36 | } 37 | \keyword{internal} 38 | -------------------------------------------------------------------------------- /man/data_rob2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_data.R 3 | \docType{data} 4 | \name{data_rob2} 5 | \alias{data_rob2} 6 | \title{Example ROB2.0 assessment dataset} 7 | \format{ 8 | A data frame with the following 7 columns: 9 | \describe{ 10 | \item{Study}{Study identifier} 11 | \item{D1}{Domain 1 - Bias arising from the randomization process} 12 | \item{D2}{Domain 2 - Bias due to deviations from intended intervention} 13 | \item{D3}{Domain 3 - Bias due to missing outcome data} 14 | \item{D4}{Domain 4 - Bias in measurement of the outcome} 15 | \item{D5}{Domain 5 - Bias in selection of the reported result} 16 | \item{Overall}{Overall risk of bias} 17 | } 18 | } 19 | \source{ 20 | {Created for this package} 21 | } 22 | \usage{ 23 | data_rob2 24 | } 25 | \description{ 26 | A data frame containing 9 example assessments performed using 27 | the RoB 2.0 tool for randomised controlled trials. 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/data_rob2_cluster.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_data.R 3 | \docType{data} 4 | \name{data_rob2_cluster} 5 | \alias{data_rob2_cluster} 6 | \title{Example ROB2.0 (cluster variant) assessment dataset} 7 | \format{ 8 | A data frame with the following 7 columns: 9 | 10 | \describe{ 11 | \item{Study}{Study identifier} 12 | \item{D1}{Domain 1 - Bias arising from the randomization process} 13 | \item{D1b}{Domain 1b - Bias arising from the timing of identification and recruitment of Individual participants in relation to timing of randomization} 14 | \item{D2}{Domain 2 - Bias due to deviations from intended intervention} 15 | \item{D3}{Domain 3 - Bias due to missing outcome data} 16 | \item{D4}{Domain 4 - Bias in measurement of the outcome} 17 | \item{D5}{Domain 5 - Bias in selection of the reported result} 18 | \item{Overall}{Overall risk of bias} 19 | } 20 | } 21 | \source{ 22 | {Created for this package} 23 | } 24 | \usage{ 25 | data_rob2_cluster 26 | } 27 | \description{ 28 | A data frame containing 9 example assessments performed using 29 | the cluster-randomised version of the RoB 2.0 tool. 30 | } 31 | \keyword{internal} 32 | -------------------------------------------------------------------------------- /man/data_robins_e.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_data.R 3 | \docType{data} 4 | \name{data_robins_e} 5 | \alias{data_robins_e} 6 | \title{Example ROBINS-E assessment} 7 | \format{ 8 | A data frame with the following 9 columns: 9 | 10 | \describe{ 11 | \item{Study}{Study identifier} 12 | \item{D1}{Domain 1 - Bias due to confounding} 13 | \item{D2}{Domain 2 - Bias arising from measurement of the exposure} 14 | \item{D3}{Domain 3 - Bias in selection of participants into the study (or into the analysis)} 15 | \item{D4}{Domain 4 - Bias due to post-exposure interventions} 16 | \item{D5}{Domain 5 - Bias due to missing data} 17 | \item{D6}{Domain 6 - Bias arising from measurement of the outcome} 18 | \item{D7}{Domain 7 - Bias in selection of the reported result} 19 | \item{Overall}{Overall risk of bias} 20 | } 21 | } 22 | \source{ 23 | {Created for this package} 24 | } 25 | \usage{ 26 | data_robins_e 27 | } 28 | \description{ 29 | A data frame containing 10 example assessments performed using 30 | the ROBINS-E (Risk Of Bias In Non-randomised Studies - of Exposures) tool. 31 | } 32 | \keyword{internal} 33 | -------------------------------------------------------------------------------- /man/data_robins_i.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_data.R 3 | \docType{data} 4 | \name{data_robins_i} 5 | \alias{data_robins_i} 6 | \title{Example ROBINS-I assessment dataset} 7 | \format{ 8 | A data frame with the following 9 columns: 9 | 10 | \describe{ 11 | \item{Study}{Study identifier} 12 | \item{D1}{Domain 1 - Bias due to confounding} 13 | \item{D2}{Domain 2 - Bias due to selection of participants} 14 | \item{D3}{Domain 3 - Bias in classification of interventions} 15 | \item{D4}{Domain 4 - Bias due to deviations from intended interventions} 16 | \item{D5}{Domain 5 - Bias due to missing data} 17 | \item{D6}{Domain 6 - Bias in measurement of outcomes} 18 | \item{D7}{Domain 7 - Bias in selection of the reported result} 19 | \item{Overall}{Overall risk of bias} 20 | } 21 | } 22 | \source{ 23 | {Created for this package} 24 | } 25 | \usage{ 26 | data_robins_i 27 | } 28 | \description{ 29 | A data frame containing 10 example assessments performed using 30 | the ROBINS-I (Risk Of Bias In Non-randomised Studies - of Interventions) tool. 31 | } 32 | \keyword{internal} 33 | -------------------------------------------------------------------------------- /man/figures/rob_forest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/man/figures/rob_forest.png -------------------------------------------------------------------------------- /man/figures/robplot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/man/figures/robplot1.png -------------------------------------------------------------------------------- /man/figures/robplot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/man/figures/robplot2.png -------------------------------------------------------------------------------- /man/figures/robplot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/man/figures/robplot3.png -------------------------------------------------------------------------------- /man/figures/robplot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/man/figures/robplot4.png -------------------------------------------------------------------------------- /man/figures/robplot5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/man/figures/robplot5.png -------------------------------------------------------------------------------- /man/figures/robplot6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/man/figures/robplot6.png -------------------------------------------------------------------------------- /man/figures/robplot7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/man/figures/robplot7.png -------------------------------------------------------------------------------- /man/figures/robvis_hex_box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/man/figures/robvis_hex_box.png -------------------------------------------------------------------------------- /man/pipe.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils-pipe.R 3 | \name{\%>\%} 4 | \alias{\%>\%} 5 | \title{Pipe operator} 6 | \usage{ 7 | lhs \%>\% rhs 8 | } 9 | \arguments{ 10 | \item{lhs}{A value or the magrittr placeholder.} 11 | 12 | \item{rhs}{A function call using the magrittr semantics.} 13 | } 14 | \value{ 15 | The result of calling `rhs(lhs)`. 16 | } 17 | \description{ 18 | See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/rob_append_weights.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_tools.R 3 | \name{rob_append_weights} 4 | \alias{rob_append_weights} 5 | \title{Extract weights from metafor results object and append to risk-of-bias data.} 6 | \usage{ 7 | rob_append_weights(data, res) 8 | } 9 | \arguments{ 10 | \item{data}{Risk of bias dataset (without a weight column)} 11 | 12 | \item{res}{metafor results object} 13 | } 14 | \description{ 15 | Used to prepare a risk-of-bias dataset to be passed to the 16 | weighted barplot function: rob_summary(..., weighted = TRUE) 17 | } 18 | \examples{ 19 | \donttest{ 20 | dat.bcg <- metadat::dat.bcg[c(1:9),] 21 | 22 | dat <- 23 | metafor::escalc( 24 | measure = "RR", 25 | ai = tpos, 26 | bi = tneg, 27 | ci = cpos, 28 | di = cneg, 29 | data = dat.bcg, 30 | slab = paste(author, year) 31 | ) 32 | 33 | res <- metafor::rma(yi, vi, data = dat) 34 | 35 | data_rob2$Study <- paste(dat$author,dat$year) 36 | 37 | rob_weighted_data <- rob_append_weights(data_rob2[,1:7], res) 38 | 39 | rob_summary(rob_weighted_data, tool = "ROB2", weighted = TRUE) 40 | } 41 | } 42 | \seealso{ 43 | Other helper: 44 | \code{\link{rob_dummy}()}, 45 | \code{\link{rob_save}()}, 46 | \code{\link{rob_tools}()} 47 | } 48 | \concept{helper} 49 | -------------------------------------------------------------------------------- /man/rob_direction.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_direction.R 3 | \name{rob_direction} 4 | \alias{rob_direction} 5 | \title{Bias direction plots} 6 | \usage{ 7 | rob_direction( 8 | dat, 9 | vi = NULL, 10 | sei = NULL, 11 | title = NULL, 12 | legend_cex = 0.9, 13 | grouping = "type", 14 | grouping_levels = c("MR", "NRSI", "NRSE", "RCT"), 15 | label_subgroup_summary = "RE Model for Subgroup", 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{dat}{Dataframe} 21 | 22 | \item{vi}{Vector containing the sampling variances (normally defined as the column within the dataset, i.e. dat$vi). Note: either vi or sei must be set.} 23 | 24 | \item{sei}{Vector containing the corresponding standard errors (normally defined as the column within the dataset, i.e. dat$sei). Note: either vi or sei must be set.} 25 | 26 | \item{title}{Graph title} 27 | 28 | \item{legend_cex}{Expansion factor for figure legend.} 29 | 30 | \item{grouping}{Variable of the provided dataset by which the resulting plot will be stratified. Often will study design or overall risk-of-bias level.} 31 | 32 | \item{grouping_levels}{Ordering of grouping variable. Note: the levels will be plotted 33 | in order, starting at the bottom of the graph (i.e. the last item in the 34 | vector will be placed at the top of the graph)} 35 | 36 | \item{label_subgroup_summary}{Annotation text for subgroup label} 37 | 38 | \item{...}{Other arguments to pass to metafor::forest} 39 | } 40 | \description{ 41 | Used to 42 | } 43 | \keyword{internal} 44 | -------------------------------------------------------------------------------- /man/rob_dummy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_dummy.R 3 | \name{rob_dummy} 4 | \alias{rob_dummy} 5 | \title{Create "realistic" dummy risk of bias assessment data} 6 | \usage{ 7 | rob_dummy(n, tool = "ROB2", study = TRUE) 8 | } 9 | \arguments{ 10 | \item{n}{Number of assessments to create} 11 | 12 | \item{tool}{Tool used for assessment (see rob_tools()). Default is "ROB2".} 13 | 14 | \item{study}{Should the returned dataframe contain a "Study" column. Default 15 | is true.} 16 | } 17 | \description{ 18 | This function returns N example risk of bias assessments for the 19 | tool specified, where N is set by the user. Assessments are "realistic" in 20 | that the judgment in the overall column is set to the highest judgement 21 | across the domains for a given study, reflecting the recommendations of the 22 | tool creators. 23 | } 24 | \seealso{ 25 | Other helper: 26 | \code{\link{rob_append_weights}()}, 27 | \code{\link{rob_save}()}, 28 | \code{\link{rob_tools}()} 29 | } 30 | \concept{helper} 31 | -------------------------------------------------------------------------------- /man/rob_forest.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_forest.R 3 | \name{rob_forest} 4 | \alias{rob_forest} 5 | \title{Append a risk-of-bias traffic-light plot to a forest plot} 6 | \usage{ 7 | rob_forest( 8 | res, 9 | rob_tool = "ROB2", 10 | rob_me = NULL, 11 | rob_levels = NULL, 12 | title = NULL, 13 | rob_legend = TRUE, 14 | rob_legend_cex = 0.9, 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{res}{Output from metafor meta-analysis function} 20 | 21 | \item{rob_tool}{The risk-of-bias assessment tool used to perform the 22 | assessments} 23 | 24 | \item{rob_me}{Optional value defining the result of the Risk-Of-Bias due to 25 | Missing Evidence (ROB-ME) assessment for this synthesis. By default (rob_me 26 | = NULL), this is omitted from the plot.} 27 | 28 | \item{rob_levels}{Vector of judgments [e.g. c("Low","Some 29 | concerns","High","Critical")] that controls the ordering of subgroups 30 | within the plot} 31 | 32 | \item{title}{Text to use for plot title} 33 | 34 | \item{rob_legend}{Logical specifying whether a legend for the risk-of-bias 35 | plot should be shown. Default is TRUE.} 36 | 37 | \item{rob_legend_cex}{Expansion factor for the risk-of-bias legend} 38 | 39 | \item{...}{Additional arguments to be passed to the metafor::forest() 40 | function} 41 | } 42 | \description{ 43 | A wrapper for metafor::forest function, which adds a risk of 44 | bias traffic-light plot to the right-hand side of the forest plot. The 45 | heavy lifting for this function is done by metafor. Note that if not 46 | specified as additional arguments, this functions sets the header argument 47 | of metafor::forest() to TRUE. 48 | } 49 | \seealso{ 50 | Other main: 51 | \code{\link{rob_summary}()}, 52 | \code{\link{rob_traffic_light}()} 53 | } 54 | \concept{main} 55 | -------------------------------------------------------------------------------- /man/rob_save.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_save.R 3 | \name{rob_save} 4 | \alias{rob_save} 5 | \title{Save risk-of-bias plots to a file using sensible parameters} 6 | \usage{ 7 | rob_save( 8 | rob_object, 9 | file = "rob_figure.png", 10 | height = "default", 11 | width = "default", 12 | dpi = 800 13 | ) 14 | } 15 | \arguments{ 16 | \item{rob_object}{Object created using either rob_summary() or 17 | rob_traffic_light()} 18 | 19 | \item{file}{Destination file, with extension (e.g. "rob_figure.png")} 20 | 21 | \item{height}{Height of resulting image, in inches. Defaults to "default" 22 | which uses recommended values based on the number of studies included.} 23 | 24 | \item{width}{Width of resulting image, in inches. Defaults to "default" which 25 | uses recommended values based on the number of characters in the Study and 26 | Domain names. dpi} 27 | 28 | \item{dpi}{Plot resolution.} 29 | } 30 | \description{ 31 | Save risk-of-bias plots to a file using sensible parameters 32 | } 33 | \seealso{ 34 | Other helper: 35 | \code{\link{rob_append_weights}()}, 36 | \code{\link{rob_dummy}()}, 37 | \code{\link{rob_tools}()} 38 | } 39 | \concept{helper} 40 | -------------------------------------------------------------------------------- /man/rob_summary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_summary.R 3 | \name{rob_summary} 4 | \alias{rob_summary} 5 | \title{Produce summary weighted barplots of risk-of-bias assessments.} 6 | \usage{ 7 | rob_summary( 8 | data, 9 | tool, 10 | overall = TRUE, 11 | weighted = FALSE, 12 | colour = "cochrane", 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{data}{A dataframe containing summary (domain) level risk-of-bias 18 | assessments, with the first column containing the study details, the second 19 | column containing the first domain of your assessments, and the final 20 | column containing a weight to assign to each study. The function assumes 21 | that the data includes a column for overall risk-of-bias. For example, a 22 | ROB2.0 dataset would have 7 columns (1 for study details, 5 for domain 23 | level judgments, 1 for overall judgements, in that 24 | order).} 25 | 26 | \item{tool}{The risk of bias assessment tool used. RoB2.0 (tool='ROB2'), 27 | ROBINS-I (tool='ROBINS-I'), and QUADAS-2 (tool='QUADAS-2') are currently 28 | supported.} 29 | 30 | \item{overall}{An option to include a bar for overall risk-of-bias in the 31 | figure. Default is TRUE} 32 | 33 | \item{weighted}{An option to specify whether weights should be used in the 34 | barplot. Default is FALSE.} 35 | 36 | \item{colour}{An argument to specify the colour scheme for the plot. Default 37 | is 'cochrane' which used the ubiquitous Cochrane colours, while a preset 38 | option for a colour-blind friendly palette is also available (colour = 39 | 'colourblind').} 40 | 41 | \item{...}{Arguments to be passed to the tool specific functions.} 42 | } 43 | \value{ 44 | Risk of bias assessment barplot figure. 45 | } 46 | \description{ 47 | A function to convert standard risk-of-bias output to tidy data 48 | and plot a summary barplot. 49 | } 50 | \examples{ 51 | 52 | data <- data.frame( 53 | stringsAsFactors = FALSE, 54 | Study = c("Study 1", "Study 2"), 55 | D1 = c("Low", "Some concerns"), 56 | D2 = c("Low", "Low"), 57 | D3 = c("Low", "Low"), 58 | D4 = c("Low", "Low"), 59 | D5 = c("Low", "Low"), 60 | Overall = c("Low", "Low"), 61 | Weight = c(33.33333333, 33.33333333) 62 | ) 63 | 64 | rob_summary(data, "ROB2") 65 | } 66 | \seealso{ 67 | Other main: 68 | \code{\link{rob_forest}()}, 69 | \code{\link{rob_traffic_light}()} 70 | } 71 | \concept{main} 72 | -------------------------------------------------------------------------------- /man/rob_tools.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_tools.R 3 | \name{rob_tools} 4 | \alias{rob_tools} 5 | \title{List the risk-of-bias tools for which templates are available within the package.} 6 | \usage{ 7 | rob_tools(forest = FALSE) 8 | } 9 | \arguments{ 10 | \item{forest}{Show the tools supported by the forest/blobbogram functions} 11 | } 12 | \description{ 13 | rob_tools() will list the risk-of-bias assessment tools for 14 | which templates already exist within the robvis package. If the assessment 15 | tool you used does not appear in the list, use the "Generic" template. 16 | } 17 | \examples{ 18 | rob_tools() 19 | } 20 | \seealso{ 21 | Other helper: 22 | \code{\link{rob_append_weights}()}, 23 | \code{\link{rob_dummy}()}, 24 | \code{\link{rob_save}()} 25 | } 26 | \concept{helper} 27 | -------------------------------------------------------------------------------- /man/rob_traffic_light.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rob_traffic_light.R 3 | \name{rob_traffic_light} 4 | \alias{rob_traffic_light} 5 | \title{Produce traffic-light plots of risk-of-bias assessments.} 6 | \usage{ 7 | rob_traffic_light( 8 | data, 9 | tool, 10 | colour = "cochrane", 11 | psize = 10, 12 | overall = TRUE, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{data}{A dataframe containing summary (domain) level risk-of-bias 18 | assessments, with the first column containing the study details, the second 19 | column containing the first domain of your assessments, and the final 20 | column containing a weight to assign to each study. The function assumes 21 | that the data includes a column for overall risk-of-bias. For example, a 22 | ROB2.0 dataset would have 7 columns (1 for study details, 5 for domain 23 | level judgments, and 1 for overall judgement, in that 24 | order). See} 25 | 26 | \item{tool}{The risk of bias assessment tool used. RoB2.0 (tool='ROB2'), 27 | ROBINS-I (tool='ROBINS-I'), and QUADAS-2 (tool='QUADAS-2') are currently 28 | supported.} 29 | 30 | \item{colour}{An argument to specify the colour scheme for the plot. Default 31 | is 'cochrane' which used the ubiquitous Cochrane colours, while a preset 32 | option for a colour-blind friendly palette is also available (colour = 33 | 'colourblind').} 34 | 35 | \item{psize}{Control the size of the traffic lights. Default is 10.} 36 | 37 | \item{overall}{Logical, specifying whether to include an "Overall" risk of 38 | bias column in the resulting plot} 39 | 40 | \item{...}{Arguments to be passed to the tool specific functions.} 41 | } 42 | \value{ 43 | Risk-of-bias assessment traffic light plot (ggplot2 object) 44 | } 45 | \description{ 46 | A function to take a summary table of risk of bias assessments 47 | and produce a traffic light plot from it. 48 | } 49 | \examples{ 50 | 51 | data <- data.frame( 52 | stringsAsFactors = FALSE, 53 | Study = c("Study 1", "Study 2"), 54 | D1 = c("Low", "Some concerns"), 55 | D2 = c("Low", "Low"), 56 | D3 = c("Low", "Low"), 57 | D4 = c("Low", "Low"), 58 | D5 = c("Low", "Low"), 59 | Overall = c("Low", "Low") 60 | ) 61 | 62 | rob_traffic_light(data, "ROB2") 63 | } 64 | \seealso{ 65 | Other main: 66 | \code{\link{rob_forest}()}, 67 | \code{\link{rob_summary}()} 68 | } 69 | \concept{main} 70 | -------------------------------------------------------------------------------- /man/robvis.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/robvis.R 3 | \docType{package} 4 | \name{robvis} 5 | \alias{robvis} 6 | \title{robvis: A package for producing risk-of-bias assessment figures.} 7 | \description{ 8 | The robvis package is designed to help users produce publication quality 9 | risk-of-bias assessment figures. 10 | } 11 | \keyword{internal} 12 | -------------------------------------------------------------------------------- /robvis.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace,vignette 22 | -------------------------------------------------------------------------------- /tests/spelling.R: -------------------------------------------------------------------------------- 1 | if(requireNamespace('spelling', quietly = TRUE)) 2 | spelling::spell_check_test(vignettes = TRUE, error = FALSE, 3 | skip_on_cran = TRUE) 4 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(robvis) 3 | 4 | test_check("robvis") 5 | -------------------------------------------------------------------------------- /tests/testthat/Rplots.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/Rplots.pdf -------------------------------------------------------------------------------- /tests/testthat/_snaps/forest/paired_rob2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/forest/paired_rob2.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/forest/paired_rob2_complex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/forest/paired_rob2_complex.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/forest/paired_robinse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/forest/paired_robinse.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/forest/paired_robinsi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/forest/paired_robinsi.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/forest/paired_robinsi_complex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/forest/paired_robinsi_complex.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_paired_direction/paried_basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_paired_direction/paried_basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/QUADAS - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/QUADAS - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/QUADAS - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/QUADAS - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/QUADAS - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/QUADAS - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/QUADAS - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/QUADAS - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/QUADAS - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/QUADAS - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/QUIPS - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/QUIPS - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/QUIPS - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/QUIPS - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/QUIPS - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/QUIPS - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/QUIPS - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/QUIPS - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/QUIPS - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/QUIPS - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB1 - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB1 - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB1 - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB1 - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB1 - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB1 - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB1 - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB1 - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB1 - Judgement Labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB1 - Judgement Labels.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB1 - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB1 - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB1 - ROBINS-I Judgement Labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB1 - ROBINS-I Judgement Labels.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB2 - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB2 - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB2 - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB2 - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB2 - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB2 - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB2 - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB2 - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROB2 - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROB2 - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROBINS-E - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROBINS-E - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROBINS-E - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROBINS-E - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROBINS-E - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROBINS-E - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROBINS-E - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROBINS-E - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROBINS-E - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROBINS-E - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROBINS-I - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROBINS-I - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROBINS-I - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROBINS-I - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROBINS-I - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROBINS-I - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROBINS-I - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROBINS-I - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_summary/ROBINS-I - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_summary/ROBINS-I - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Point size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUADAS - Point size.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Point Size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - QUIPS - Point Size.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Point Size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2 - Point Size.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Point Size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROB2C - Point Size.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Domain Labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Domain Labels.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Judgement labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Judgement labels.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Judgement title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Judgement title.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Label x axis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Label x axis.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Label y axis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Label y axis.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Overall domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Overall domain.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Point size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBG - Point size.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Point Size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-E - Point Size.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Basic.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Colour - cochrane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Colour - cochrane.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Colour - colourblind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Colour - colourblind.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Colour - custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Colour - custom.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Overall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Overall.png -------------------------------------------------------------------------------- /tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Point Size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcguinlu/robvis/c7c1bdd9cf00e179c5c9b4c8e2ad32e7dbebafd0/tests/testthat/_snaps/rob_traffic_light/TF - ROBINS-I - Point Size.png -------------------------------------------------------------------------------- /tests/testthat/test-rob_paired_direction.R: -------------------------------------------------------------------------------- 1 | dat <- data_bias_direction %>% 2 | triangulate::tri_to_long() %>% 3 | triangulate::tri_absolute_direction() %>% 4 | triangulate::tri_to_wide() 5 | 6 | test_that("Test basic bias direction plots",{ 7 | 8 | expect_snapshot_file(save_png({ 9 | 10 | rob_direction(dat, vi = dat$vi) 11 | 12 | }), "paried_basic.png") 13 | 14 | }) 15 | -------------------------------------------------------------------------------- /tests/testthat/test_datasets.R: -------------------------------------------------------------------------------- 1 | # For all 4 datasets 2 | 3 | # Dimensions 4 | test_that("Data dimensions correct - data_rob2", { 5 | expect_equal(ncol(data_rob2), 7) 6 | expect_equal(nrow(data_rob2), 9) 7 | }) 8 | 9 | test_that("Data dimensions correct - data_rob1", { 10 | expect_equal(ncol(data_rob1), 9) 11 | expect_equal(nrow(data_rob1), 9) 12 | }) 13 | 14 | test_that("Data dimensions correct - data_robins_i", { 15 | expect_equal(ncol(data_robins_i), 9) 16 | expect_equal(nrow(data_robins_i), 10) 17 | }) 18 | 19 | test_that("Data dimensions correct - data_robins_e", { 20 | expect_equal(ncol(data_robins_e), 9) 21 | expect_equal(nrow(data_robins_e), 10) 22 | }) 23 | 24 | test_that("Data dimensions correct - data_quadas", { 25 | expect_equal(ncol(data_quadas), 6) 26 | expect_equal(nrow(data_quadas), 12) 27 | }) 28 | -------------------------------------------------------------------------------- /tests/testthat/test_errors.R: -------------------------------------------------------------------------------- 1 | # Tool must be specified 2 | test_that("No tool specified", { 3 | expect_error(rob_summary(data_rob2)) 4 | expect_error(rob_traffic_light(data_rob2)) 5 | }) 6 | 7 | test_that("Tool specified incorrectly", { 8 | expect_error(rob_summary(data_rob2, "Rob2")) 9 | expect_error(rob_traffic_light(data_rob2, "Rob2")) 10 | }) 11 | 12 | 13 | test_that("ROB1 gives message", { 14 | expect_message(rob_summary(data_rob1, "ROB1")) 15 | expect_message(rob_traffic_light(data_rob1, "ROB1")) 16 | }) 17 | 18 | test_that("Colour errors", { 19 | expect_error(rob_summary(data_rob2, "ROB2", colour = c("#FFFFFF"))) 20 | expect_error(rob_traffic_light(data_robins_i,"ROBINS-I", colour = c("#FFFFFF"))) 21 | }) 22 | 23 | test_sum <- data_rob2[, c(1:6)] 24 | test_tf <- data_rob2[, c(1:6)] 25 | 26 | test_that("Too few columns", { 27 | expect_error(rob_summary(test_sum, "ROB2")) 28 | expect_error(rob_traffic_light(test_tf, "ROB2")) 29 | }) 30 | 31 | test_sum <- data_robins_i[, c(1:8)] 32 | test_tf <- data_robins_i[, c(1:8)] 33 | 34 | test_that("Too few columns", { 35 | expect_error(rob_summary(test_sum, "ROBINS-I")) 36 | expect_error(rob_traffic_light(test_tf, "ROBINS-I")) 37 | expect_error(rob_traffic_light(data_rob2[, 1:7], tool = "ROB2-Cluster")) 38 | }) 39 | 40 | test_sum <- data_quadas[, c(1:6)] 41 | test_tf <- data_quadas[, c(1:5)] 42 | 43 | test_that("Too few columns", { 44 | expect_error(rob_summary(test_sum, "QUADAS-2", weighted = TRUE)) 45 | expect_error(rob_traffic_light(test_tf, "QUADAS-2")) 46 | }) 47 | 48 | test_that("Error on saving with wrong file ext",{ 49 | expect_error(rob_save(rob_fig,"test.pgg")) 50 | }) 51 | 52 | # Need to add specific test for ROB1 53 | 54 | data_header <- data_rob2 55 | data_header[1,] <- as.list(names(data_header)) 56 | 57 | test_that("Data contains headers", { 58 | expect_error(rob_summary(data_header, "ROB2")) 59 | expect_error(rob_traffic_light(data_header, "ROB2")) 60 | }) 61 | 62 | test_that("Expected number of domain shortcodes", { 63 | expect_error(rob_traffic_light(data_rob1, "Generic", domain_shortcodes = c("R1"))) 64 | expect_error(rob_traffic_light(data_rob1[,1:3], "Generic", overall = FALSE, domain_shortcodes = c("R1", "R1"))) 65 | }) 66 | 67 | 68 | #-#-#-# 69 | 70 | res <- c() 71 | 72 | test_that("Check class of results object ", { 73 | expect_error(rob_append_weights(data_rob2, res)) 74 | expect_error(rob_append_to_forest(res, data_rob2)) 75 | }) 76 | 77 | -------------------------------------------------------------------------------- /tests/testthat/test_forest.R: -------------------------------------------------------------------------------- 1 | # Set-up ---- 2 | 3 | # Perform meta-analysis 4 | set.seed(1) 5 | 6 | test_that("Check paired plots", { 7 | expect_snapshot_file(save_png({ 8 | rob_forest(get_res("ROB2"),"ROB2") 9 | 10 | }), "paired_rob2.png") 11 | 12 | 13 | expect_snapshot_file(save_png({ 14 | rob_forest(get_res("ROBINS-I"),"ROBINS-I") 15 | 16 | }), "paired_robinsi.png") 17 | 18 | expect_snapshot_file(save_png({ 19 | rob_forest(get_res("ROBINS-E"),"ROBINS-E") 20 | 21 | }), "paired_robinse.png") 22 | 23 | 24 | expect_snapshot_file(save_png({ 25 | rob_forest( 26 | get_res("ROB2"), 27 | atransf = exp, 28 | xlim = c(-16, 7), 29 | at = log(c(.05, .25, 1, 4)), 30 | ilab = cbind(metadat::dat.bcg$tpos, 31 | metadat::dat.bcg$tneg, 32 | metadat::dat.bcg$cpos, 33 | metadat::dat.bcg$cneg), 34 | ilab.xpos = c(-9.5, -8, -6, -4.5), 35 | header = "Author(s) and Year", 36 | textpos = c(-16, 6), 37 | cex = 1, 38 | mlab = "RE Model (Q=" 39 | ) 40 | }), "paired_rob2_complex.png") 41 | 42 | expect_snapshot_file(save_png({ 43 | rob_forest( 44 | get_res("ROBINS-I"), 45 | rob_tool = "ROBINS-I", 46 | atransf = exp, 47 | xlim = c(-16, 7), 48 | at = log(c(.05, .25, 1, 4)), 49 | ilab = cbind(metadat::dat.bcg$tpos, 50 | metadat::dat.bcg$tneg, 51 | metadat::dat.bcg$cpos, 52 | metadat::dat.bcg$cneg), 53 | ilab.xpos = c(-9.5, -8, -6, -4.5), 54 | header = "Author(s) and Year", 55 | textpos = c(-16, 6), 56 | cex = 1, 57 | mlab = "RE Model (Q=" 58 | ) 59 | }), "paired_robinsi_complex.png") 60 | 61 | }) 62 | -------------------------------------------------------------------------------- /tests/testthat/test_helpers.R: -------------------------------------------------------------------------------- 1 | test_that("Correct number of colours returned", { 2 | expect_equal(length(get_colour("ROB2", "cochrane")), 5) 3 | expect_equal(length(get_colour("ROB2", "colourblind")), 5) 4 | }) 5 | 6 | test_that("Convert weird spelling of colour", { 7 | expect_equal(clean_colour_spelling("colorblind"), "colourblind") 8 | }) 9 | -------------------------------------------------------------------------------- /tests/testthat/test_rob_append_weights.R: -------------------------------------------------------------------------------- 1 | dat.bcg <- metadat::dat.bcg[c(1:9),] 2 | 3 | dat <- 4 | metafor::escalc( 5 | measure = "RR", 6 | ai = tpos, 7 | bi = tneg, 8 | ci = cpos, 9 | di = cneg, 10 | data = dat.bcg, 11 | slab = paste(author, year) 12 | ) 13 | 14 | res <- metafor::rma(yi, vi, data = dat) 15 | 16 | data_rob_noweights <- data_rob2[,c(1:7)] 17 | data_rob_noweights$Study <- paste(dat$author,dat$year) 18 | 19 | test_that("Check weight column is added without error", { 20 | expect_equal(ncol(rob_append_weights(data_rob_noweights, res)),8) 21 | }) 22 | 23 | data_rob_noweights[3,1] <- "" 24 | 25 | test_that("Check mismatched study names gives error", { 26 | expect_error(rob_append_weights(data_rob_noweights, res)) 27 | }) 28 | -------------------------------------------------------------------------------- /tests/testthat/test_rob_save.R: -------------------------------------------------------------------------------- 1 | rob_fig <- rob_traffic_light(data_rob2, "ROB2") 2 | 3 | rob_save(rob_fig,"test.png") 4 | 5 | test_that("Test PNG download", { 6 | expect_equal(file.exists("test.png"),TRUE) 7 | }) 8 | 9 | if (file.exists("test.png") == TRUE) { 10 | unlink("test.png", recursive = TRUE) 11 | } 12 | 13 | rob_save(rob_fig,"test.jpeg") 14 | 15 | test_that("Test jpeg download", { 16 | expect_equal(file.exists("test.jpeg"),TRUE) 17 | }) 18 | 19 | if (file.exists("test.jpeg") == TRUE) { 20 | unlink("test.jpeg", recursive = TRUE) 21 | } 22 | 23 | rob_save(rob_fig,"test.tiff") 24 | 25 | test_that("Test tiff download", { 26 | expect_equal(file.exists("test.tiff"),TRUE) 27 | }) 28 | 29 | if (file.exists("test.tiff") == TRUE) { 30 | unlink("test.tiff", recursive = TRUE) 31 | } 32 | 33 | rob_save(rob_fig,"test.eps") 34 | 35 | test_that("Test eps download", { 36 | expect_equal(file.exists("test.eps"),TRUE) 37 | }) 38 | 39 | if (file.exists("test.eps") == TRUE) { 40 | unlink("test.eps", recursive = TRUE) 41 | } 42 | -------------------------------------------------------------------------------- /tests/testthat/test_rob_summary.R: -------------------------------------------------------------------------------- 1 | test_that("ROB - Summary", { 2 | expect_snapshot_file(name = "ROB2 - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob2, "ROB2"))) 3 | expect_snapshot_file(name = "ROB2 - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob2[1:6], "ROB2", overall = FALSE))) 4 | expect_snapshot_file(name = "ROB2 - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob2, "ROB2", colour = "cochrane"))) 5 | expect_snapshot_file(name = "ROB2 - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob2, "ROB2", colour = "colourblind"))) 6 | expect_snapshot_file(name = "ROB2 - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob2, "ROB2", colour = c("#f442c8", "#bef441", "#000000", "#bef441")))) 7 | 8 | expect_snapshot_file(name = "ROB1 - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob1, "Generic"))) 9 | expect_snapshot_file(name = "ROB1 - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob1[1:8], "Generic", overall = FALSE))) 10 | expect_snapshot_file(name = "ROB1 - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob1, "Generic", colour = "cochrane"))) 11 | expect_snapshot_file(name = "ROB1 - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob1, "Generic", colour = "colourblind"))) 12 | expect_snapshot_file(name = "ROB1 - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob1, "Generic", colour = c("#f442c8", "#bef441", "#000000", "#bef441", "#4EA1F7")))) 13 | expect_snapshot_file(name = "ROB1 - Judgement Labels.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_rob1, "Generic", judgement_labels = c("Test1","Test2","Test3","Test4","NI")))) 14 | expect_snapshot_file(name = "ROB1 - ROBINS-I Judgement Labels.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_i, "Generic", judgement_labels = c("Test1","Test2","Test3","Test4","NI"), overall = TRUE))) 15 | 16 | expect_snapshot_file(name = "ROBINS-I - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_i, "ROBINS-I"))) 17 | expect_snapshot_file(name = "ROBINS-I - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_i[1:8], "ROBINS-I", overall = FALSE))) 18 | expect_snapshot_file(name = "ROBINS-I - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_i, "ROBINS-I", colour = "cochrane"))) 19 | expect_snapshot_file(name = "ROBINS-I - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_i, "ROBINS-I", colour = "colourblind"))) 20 | expect_snapshot_file(name = "ROBINS-I - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_i, "ROBINS-I", colour = c("#f442c8", "#bef441", "#000000", "#bef441", "#4EA1F7")))) 21 | 22 | expect_snapshot_file(name = "ROBINS-E - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_e, "ROBINS-E"))) 23 | expect_snapshot_file(name = "ROBINS-E - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_e[1:8], "ROBINS-E", overall = FALSE))) 24 | expect_snapshot_file(name = "ROBINS-E - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_e, "ROBINS-E", colour = "cochrane"))) 25 | expect_snapshot_file(name = "ROBINS-E - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_e, "ROBINS-E", colour = "colourblind"))) 26 | expect_snapshot_file(name = "ROBINS-E - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_robins_e, "ROBINS-E", colour = c("#f442c8", "#bef441", "#000000", "#bef441", "#4EA1F7")))) 27 | 28 | expect_snapshot_file(name = "QUIPS - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_quips, "QUIPS"))) 29 | expect_snapshot_file(name = "QUIPS - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_quips[1:7], "QUIPS", overall = FALSE))) 30 | expect_snapshot_file(name = "QUIPS - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_quips, "QUIPS", colour = "cochrane"))) 31 | expect_snapshot_file(name = "QUIPS - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_quips, "QUIPS", colour = "colourblind"))) 32 | expect_snapshot_file(name = "QUIPS - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_quips, "QUIPS", colour = c("#f442c8", "#bef441", "#000000", "#bef441", "#4EA1F7")))) 33 | 34 | expect_snapshot_file(name = "QUADAS - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_quadas, "QUADAS-2"))) 35 | expect_snapshot_file(name = "QUADAS - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_quadas[1:5], "QUADAS-2", overall = FALSE))) 36 | expect_snapshot_file(name = "QUADAS - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_quadas, "QUADAS-2", colour = "cochrane"))) 37 | expect_snapshot_file(name = "QUADAS - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_quadas, "QUADAS-2", colour = "colourblind"))) 38 | expect_snapshot_file(name = "QUADAS - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_summary(data_quadas, "QUADAS-2", colour = c("#f442c8", "#bef441", "#000000", "#bef441")))) 39 | }) 40 | -------------------------------------------------------------------------------- /tests/testthat/test_rob_tools.R: -------------------------------------------------------------------------------- 1 | test_that("Length of rob_tools() output", { 2 | expect_equal(length(suppressMessages(rob_tools())), 7) 3 | }) 4 | 5 | -------------------------------------------------------------------------------- /tests/testthat/test_rob_traffic_light.R: -------------------------------------------------------------------------------- 1 | 2 | language_dat <- data_rob2 3 | names(language_dat)[7] <- "Globale" 4 | 5 | test_that("ROB - Traffic light", { 6 | expect_snapshot_file(name = "TF - ROB2 - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, "ROB2"))) 7 | expect_snapshot_file(name = "TF - ROB2 - Point Size.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, "ROB2", psize = 10))) 8 | expect_snapshot_file(name = "TF - ROB2 - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, "ROB2", colour = "cochrane"))) 9 | expect_snapshot_file(name = "TF - ROB2 - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, "ROB2", colour = "colourblind"))) 10 | expect_snapshot_file(name = "TF - ROB2 - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, "ROB2", colour = c("#f442c8", "#bef441", "#000000", "#333333")))) 11 | expect_snapshot_file(name = "TF - ROB2 - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2[1:6], "ROB2", overall = FALSE))) 12 | 13 | expect_snapshot_file(name = "TF - ROB2C - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2_cluster, "ROB2-Cluster"))) 14 | expect_snapshot_file(name = "TF - ROB2C - Point Size.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2_cluster, "ROB2-Cluster", psize = 10))) 15 | expect_snapshot_file(name = "TF - ROB2C - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2_cluster, "ROB2-Cluster", colour = "cochrane"))) 16 | expect_snapshot_file(name = "TF - ROB2C - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2_cluster, "ROB2-Cluster", colour = "colourblind"))) 17 | expect_snapshot_file(name = "TF - ROB2C - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2_cluster, "ROB2-Cluster", colour = c("#f442c8", "#bef441", "#000000", "#333333")))) 18 | expect_snapshot_file(name = "TF - ROB2C - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2_cluster[1:7], "ROB2-Cluster", overall = FALSE))) 19 | 20 | expect_snapshot_file(name = "TF - ROBINS-I - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_i, "ROBINS-I"))) 21 | expect_snapshot_file(name = "TF - ROBINS-I - Point Size.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_i, "ROBINS-I", psize = 10))) 22 | expect_snapshot_file(name = "TF - ROBINS-I - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_i, "ROBINS-I", colour = "cochrane"))) 23 | expect_snapshot_file(name = "TF - ROBINS-I - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_i, "ROBINS-I", colour = "colourblind"))) 24 | expect_snapshot_file(name = "TF - ROBINS-I - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_i, "ROBINS-I", colour = c("#f442c8", "#bef441", "#000000", "#bef441", "#333333")))) 25 | expect_snapshot_file(name = "TF - ROBINS-I - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_i[1:8], "ROBINS-I", overall = FALSE))) 26 | 27 | expect_snapshot_file(name = "TF - ROBINS-E - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_e, "ROBINS-E"))) 28 | expect_snapshot_file(name = "TF - ROBINS-E - Point Size.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_e, "ROBINS-E", psize = 10))) 29 | expect_snapshot_file(name = "TF - ROBINS-E - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_e, "ROBINS-E", colour = "cochrane"))) 30 | expect_snapshot_file(name = "TF - ROBINS-E - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_e, "ROBINS-E", colour = "colourblind"))) 31 | expect_snapshot_file(name = "TF - ROBINS-E - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_e, "ROBINS-E", colour = c("#f442c8", "#bef441", "#000000", "#bef441", "#333333")))) 32 | expect_snapshot_file(name = "TF - ROBINS-E - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_robins_e[1:8], "ROBINS-E", overall = FALSE))) 33 | 34 | expect_snapshot_file(name = "TF - QUADAS - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quadas, "QUADAS-2"))) 35 | expect_snapshot_file(name = "TF - QUADAS - Point size.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quadas, "QUADAS-2", psize = 10))) 36 | expect_snapshot_file(name = "TF - QUADAS - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quadas, "QUADAS-2", colour = "cochrane"))) 37 | expect_snapshot_file(name = "TF - QUADAS - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quadas, "QUADAS-2", colour = "colourblind"))) 38 | expect_snapshot_file(name = "TF - QUADAS - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quadas, "QUADAS-2", colour = c("#f442c8", "#bef441", "#000000", "#333333")))) 39 | expect_snapshot_file(name = "TF - QUADAS - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quadas[1:5], "QUADAS-2", overall = FALSE))) 40 | 41 | expect_snapshot_file(name = "TF - QUIPS - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quips, "QUIPS"))) 42 | expect_snapshot_file(name = "TF - QUIPS - Point Size.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quips, "QUIPS", psize = 10))) 43 | expect_snapshot_file(name = "TF - QUIPS - Colour - cochrane.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quips, "QUIPS", colour = "cochrane"))) 44 | expect_snapshot_file(name = "TF - QUIPS - Colour - colourblind.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quips, "QUIPS", colour = "colourblind"))) 45 | expect_snapshot_file(name = "TF - QUIPS - Colour - custom.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quips, "QUIPS", colour = c("#f442c8", "#bef441", "#000000", "#bef441", "#333333")))) 46 | expect_snapshot_file(name = "TF - QUIPS - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_quips[1:7], "QUIPS", overall = FALSE))) 47 | 48 | expect_snapshot_file(name = "TF - ROBG - Basic.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, tool = "Generic"))) 49 | expect_snapshot_file(name = "TF - ROBG - Point size.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, tool = "Generic", psize = 15))) 50 | expect_snapshot_file(name = "TF - ROBG - Judgement labels.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, tool = "Generic", judgement_labels = c("Very bad", "Pretty bad", "Not sure", "Good", "No info", "NA")))) 51 | expect_snapshot_file(name = "TF - ROBG - Judgement title.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, tool = "Generic", judgement_title = "Assessment"))) 52 | expect_snapshot_file(name = "TF - ROBG - Overall domain.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(language_dat, tool = "Generic"))) 53 | expect_snapshot_file(name = "TF - ROBG - Label x axis.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, tool = "Generic", x_title = "ROB domains"))) 54 | expect_snapshot_file(name = "TF - ROBG - Label y axis.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2, tool = "Generic", y_title = "Trial"))) 55 | expect_snapshot_file(name = "TF - ROBG - Overall.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob2[1:6], "Generic", overall = FALSE))) 56 | expect_snapshot_file(name = "TF - ROBG - Domain Labels.png", rob_save(file = tempfile(fileext = ".png"), rob_traffic_light(data_rob1[1:6], "Generic", overall = FALSE, domain_shortcodes = c("R1","R2","R3", "A1","A2")))) 57 | 58 | }) 59 | -------------------------------------------------------------------------------- /vignettes/Introduction_to_robvis.R: -------------------------------------------------------------------------------- 1 | ## ----setup, include=FALSE----------------------------------------------------- 2 | knitr::opts_chunk$set( 3 | collapse = TRUE, 4 | comment = "#>", 5 | warning = FALSE, 6 | fig.width = 8, 7 | fig.height = 2.41) 8 | 9 | set.seed(42) 10 | 11 | library(robvis) 12 | 13 | 14 | ## ---- eval = TRUE------------------------------------------------------------- 15 | rob_tools() 16 | 17 | ## ---- eval=FALSE-------------------------------------------------------------- 18 | # data <- read.csv("path/to/summary_table.csv", header = TRUE) 19 | 20 | ## ----headrob, echo = FALSE---------------------------------------------------- 21 | knitr::kable(data_rob2) 22 | 23 | ## ----------------------------------------------------------------------------- 24 | rob_summary(data_rob2, tool = "ROB2") 25 | 26 | ## ----------------------------------------------------------------------------- 27 | rob_summary(data_robins_i, tool = "ROBINS-I") 28 | 29 | ## ----------------------------------------------------------------------------- 30 | rob_summary(data_quadas, tool = "QUADAS-2") 31 | 32 | ## ----------------------------------------------------------------------------- 33 | rob_summary(data_rob2, tool = "ROB2", overall = TRUE) 34 | 35 | ## ----------------------------------------------------------------------------- 36 | data_rob2_weighted <- data_rob2 37 | 38 | # Assign a random number between 1 and 10 as the weight for each study 39 | data_rob2_weighted$Weights <- sample(1:10,9) 40 | 41 | # Produce a weighted barplot 42 | rob_summary(data_rob2_weighted, tool = "ROB2", weighted = TRUE) 43 | 44 | ## ----------------------------------------------------------------------------- 45 | rob_summary(data = data_rob2, tool = "ROB2", colour = "colourblind") 46 | 47 | ## ----------------------------------------------------------------------------- 48 | rob_summary(data = data_rob2, tool = "ROB2", colour = c("#f442c8","#bef441","#000000","#557925")) 49 | 50 | ## ---- fig.width = 6, fig.height = 9, fig.align="center"----------------------- 51 | rob_traffic_light(data_rob2, tool = "ROB2") 52 | 53 | ## ---- fig.width = 7.5, fig.height = 10.5, fig.align="center"------------------ 54 | rob_traffic_light(data_robins_i, tool = "ROBINS-I") 55 | 56 | ## ---- fig.width = 7.5, fig.height = 10.5, fig.align="center"------------------ 57 | rob_traffic_light(data_quadas, tool = "QUADAS-2") 58 | 59 | ## ---- fig.width = 6, fig.height = 9, fig.align="center"----------------------- 60 | # Generate larger dataset 61 | data <- rbind(data_rob2, data_rob2) 62 | data$Study <- paste("Study",seq(1,18)) 63 | 64 | # Plot with reduced point size 65 | rob_traffic_light(data, tool = "ROB2", psize = 10) 66 | 67 | ## ---- fig.width = 6, fig.height = 9, fig.align="center"----------------------- 68 | rob_traffic_light(data = data_rob2, tool = "ROB2", colour = "colourblind") 69 | 70 | ## ---- fig.width = 6, fig.height = 9, fig.align="center"----------------------- 71 | rob_traffic_light(data = data_rob2, tool = "ROB2", colour = c("#f442c8","#bef441","#000000","#557925")) 72 | 73 | ## ----------------------------------------------------------------------------- 74 | colnames(data_rob2) 75 | 76 | colnames(data_rob1) 77 | 78 | ## ---- echo = FALSE------------------------------------------------------------ 79 | colnames(data_rob1)[2] <- "This is a test" 80 | rob_summary(data_rob1, tool = "Generic") 81 | 82 | ## ---- fig.width = 7, fig.height = 9, fig.align="center", echo = FALSE--------- 83 | rob_traffic_light(data_rob1, tool = "Generic") 84 | 85 | -------------------------------------------------------------------------------- /vignettes/Introduction_to_robvis.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Introduction to `robvis`, a visualization tool for risk-of-bias assessments" 3 | author: "Luke A McGuinness" 4 | date: "`r Sys.Date()`" 5 | output: 6 | rmarkdown::html_document: 7 | toc: yes 8 | toc_depth: 4 9 | vignette: | 10 | %\VignetteIndexEntry{Introduction to robvis} 11 | %\VignetteEngine{knitr::rmarkdown} 12 | %\VignetteEncoding{UTF-8} 13 | --- 14 | ```{r setup, include=FALSE} 15 | knitr::opts_chunk$set( 16 | collapse = TRUE, 17 | comment = "#>", 18 | warning = FALSE, 19 | fig.width = 8, 20 | fig.height = 2.41) 21 | 22 | set.seed(42) 23 | 24 | library(robvis) 25 | 26 | ``` 27 | 28 | # Introduction 29 | 30 | The `robvis` package provides functions to convert a risk-of-bias assessment summary table into a summary plot or a traffic-light plot, formatted based on the specific risk-of-bias assessment tool used. 31 | 32 | `robvis` currently contains templates for the following tools: 33 | 34 | * ROB2 35 | * ROBINS-I 36 | * QUADAS-2 37 | * ROB1 38 | 39 | Users can find the exact assessment tool name expected by the `tool` argument of the `rob_summary()` and `rob_traffic_light()` functions by running: 40 | 41 | ```{r, eval = TRUE} 42 | rob_tools() 43 | ``` 44 | 45 | ## Loading your data 46 | 47 | `robvis` expects certain facts about the data you provide it. 48 | 49 | 1. The first column contains the study identifier 50 | 1. The last column will contain the overall risk-of-bias judgments 51 | 1. The first row of the data does not contain column headings. This can be achieved using the `header = TRUE` option (which indicates that the first line contains column headings) when reading in your summary table: 52 | 53 | ```{r, eval=FALSE} 54 | data <- read.csv("path/to/summary_table.csv", header = TRUE) 55 | ``` 56 | 57 | All other columns are expected to contain the results of the risk-of bias assessments for a specific domain. To elaborate, consider as an example the ROB2.0 tool which has 5 domains. The resulting data set that `robvis` would expect for this tool would have 7 columns: 58 | 59 | * Column 1: Study identifier 60 | * Column 2-6: One RoB2 domain per column 61 | * Column 7: Overall risk-of-bias judgments 62 | 63 | The only exception to this is the `"Generic"` template, which is discussed [below.](#rob1) 64 | 65 | ## Example data sets {#example-data-sets} 66 | 67 | To help users explore `robvis`, we have included an example data set for each tool template that exists in the package. For example, the `data_rob2` data set, which contains example risk-of-bias assessments performed using the RoB2.0 tool for randomized controlled trials, is presented below: 68 | 69 | ```{r headrob, echo = FALSE} 70 | knitr::kable(data_rob2) 71 | ``` 72 | 73 |
74 |
75 |
76 | 77 | # Summary plots (`rob_summary()`) 78 | 79 | This function returns a `ggplot` object displaying a weighted bar-chart of the distribution of risk-of-bias judgments across the domains of the specified tool. 80 | 81 | ## Examples: 82 | ### RoB2.0 tool for randomized controlled trials 83 | ```{r} 84 | rob_summary(data_rob2, tool = "ROB2") 85 | ``` 86 | 87 | ### ROBINS-I tool for non-randomized studies of interventions 88 | ```{r} 89 | rob_summary(data_robins_i, tool = "ROBINS-I") 90 | ``` 91 | 92 | ### QUADAS-2 tool for diagnostic test accuracy studies 93 | ```{r} 94 | rob_summary(data_quadas, tool = "QUADAS-2") 95 | ``` 96 | 97 | ## `rob_summary()` options 98 | ### Overall risk-of-bias judgments (`overall`) 99 | 100 | By default, a bar representing the overall risk-of-bias judgments is not included in the plot. If you would like to include this, set `overall = TRUE`. For example: 101 | 102 | ```{r} 103 | rob_summary(data_rob2, tool = "ROB2", overall = TRUE) 104 | ``` 105 | 106 | ### Weighted or un-weighted bar plots (`weighted`) 107 | 108 | By default, the barplot is un-weighted, in that it shows the number of studies at each level of risk of bias. However, if you provide a risk-of-bias dataset that has an additional "Weights" column containing some measure of study precision, you can produce a barplot showing the amount of _statistical information_ at each level of bias: 109 | 110 | ```{r} 111 | data_rob2_weighted <- data_rob2 112 | 113 | # Assign a random number between 1 and 10 as the weight for each study 114 | data_rob2_weighted$Weights <- sample(1:10,9) 115 | 116 | # Produce a weighted barplot 117 | rob_summary(data_rob2_weighted, tool = "ROB2", weighted = TRUE) 118 | ``` 119 | 120 | See the ["Working with `metafor`"](metafor.html) article for more information on how to extract the weights assigned to each study during a meta-analysis performed with `metafor` 121 | 122 | ### Colour scheme (`colour`) 123 | 124 | __NB: Please note the non-US English spelling of colour__ 125 | 126 | The `colour` argument of both plotting functions allows users to select from two predefined colour schemes, "cochrane" (default) or "colourblind", or to define their own palette by providing a vector of hex codes. 127 | 128 | For example, to use the predefined "colourblind" palette: 129 | 130 | ```{r} 131 | rob_summary(data = data_rob2, tool = "ROB2", colour = "colourblind") 132 | ``` 133 | 134 | And to define your own colour scheme: 135 | ```{r} 136 | rob_summary(data = data_rob2, tool = "ROB2", colour = c("#f442c8","#bef441","#000000","#557925")) 137 | ``` 138 | 139 | When defining your own colour scheme, you must ensure that the number of discrete judgments (e.g. "Low"/"Moderate"/"High"/"Critical") and the number of colours specified are the same. Additionally, colours must be specified in order of ascending risk-of-bias (e.g. "Low" -> "Critical"), with the first hex corresponding to "Low" risk of bias. 140 | 141 |
142 |
143 |
144 | 145 | # Traffic light plots (`rob_traffic_light()`) 146 | 147 | This function returns a `ggplot` object displaying the risk-of-bias judgment in each domain for each study, as well as the overall risk-of-bias judgement for that study. 148 | 149 | ## Examples: 150 | ### RoB2.0 tool for randomized controlled trials 151 | ```{r, fig.width = 6, fig.height = 9, fig.align="center"} 152 | rob_traffic_light(data_rob2, tool = "ROB2") 153 | ``` 154 | 155 | ### ROBINS-I tool for non-randomized studies of interventions 156 | ```{r, fig.width = 7.5, fig.height = 10.5, fig.align="center"} 157 | rob_traffic_light(data_robins_i, tool = "ROBINS-I") 158 | ``` 159 | 160 | ### QUADAS-2 tool for diagnostic test accuracy studies 161 | ```{r, fig.width = 7.5, fig.height = 10.5, fig.align="center"} 162 | rob_traffic_light(data_quadas, tool = "QUADAS-2") 163 | ``` 164 | 165 | ## `rob_traffic_light()` options 166 | 167 | ### Point size (`psize`) 168 | 169 | By default, the size of each point is set to 20. However, if you have a large number of studies, it is useful to be able to reduce the point size so that the resulting graphic is not too large. 170 | 171 | ```{r, fig.width = 6, fig.height = 9, fig.align="center"} 172 | # Generate larger dataset 173 | data <- rbind(data_rob2, data_rob2) 174 | data$Study <- paste("Study",seq(1,18)) 175 | 176 | # Plot with reduced point size 177 | rob_traffic_light(data, tool = "ROB2", psize = 10) 178 | ``` 179 | 180 | ### Colour scheme (`colour`) 181 | 182 | __NB: Please note the non-US English spelling of colour__ 183 | 184 | The `colour` argument of both plotting functions allows users to select from two predefined colour schemes, "cochrane" (default) or "colourblind", or to define their own palette by providing a vector of hex codes. 185 | 186 | For example, to use the predefined "colourblind" palette: 187 | 188 | ```{r, fig.width = 6, fig.height = 9, fig.align="center"} 189 | rob_traffic_light(data = data_rob2, tool = "ROB2", colour = "colourblind") 190 | ``` 191 | 192 | And to define your own colour scheme: 193 | ```{r, fig.width = 6, fig.height = 9, fig.align="center"} 194 | rob_traffic_light(data = data_rob2, tool = "ROB2", colour = c("#f442c8","#bef441","#000000","#557925")) 195 | ``` 196 | 197 | When defining your own colour scheme, you must ensure that the number of discrete judgments (e.g. "Low"/"Moderate"/"High"/"Critical") and the number of colours specified are the same. Additionally, colours must be specified in order of ascending risk-of-bias (e.g. "Low" -> "Critical"), with the first hex corresponding to "Low" risk of bias. 198 | 199 |
200 |
201 |
202 | 203 | # The "Generic" template {#rob1} 204 | 205 | ## Motivation 206 | This template offers increased flexibility in the domains that are included in the plot. It can handle any number of user defined domains and uses the user defined column headings as domains titles in the resulting figures. 207 | 208 | 209 | ## Varying numbers of domains 210 | The `"Generic"` option can handle varying numbers of columns, as authors using the ROB1 assessment tool frequently add or remove bias domains within this tool. __However, we would discourage authors from doing so with any tool other than ROB1.__ Authors using other published tools (ROB2, QUADAS-2, ROBINS-I) should use the stricter templates presented above to ensure they conform with the guidance. 211 | 212 | ## Domain names 213 | For the other tools listed above, the names of the columns containing the domain-level risk of bias judgments are not important. However, this is not the case when using the `"Generic"` template. 214 | 215 | Compare for example, the first row of the `data_rob2` and the `data_rob1`, and the resulting figures. 216 | 217 | ```{r} 218 | colnames(data_rob2) 219 | 220 | colnames(data_rob1) 221 | ``` 222 | 223 | The domain columns (Columns 2-6) in the ROB2 example have been given arbitrary names of D1-D5, as they will be overwritten by the function to correspond to the correct domain titles as per the ROB2 guidance. 224 | 225 | In contrast, the domain columns (Columns 2-8) in the ROB1 example use their true title as the column heading, as these will be used in the figures produced by `rob_summary()` and `rob_traffic_light()`. As an example, suppose we change the name of the "Random.sequence.generation" column to something else. In the `rob_summary()` figure, the title of the first bar is changed, while in the `rob_traffic_light()` figure, the caption is updated to reflect this change. 226 | 227 | ```{r, echo = FALSE} 228 | colnames(data_rob1)[2] <- "This is a test" 229 | rob_summary(data_rob1, tool = "Generic") 230 | ``` 231 | 232 | ```{r, fig.width = 7, fig.height = 9, fig.align="center", echo = FALSE} 233 | rob_traffic_light(data_rob1, tool = "Generic") 234 | ``` 235 | -------------------------------------------------------------------------------- /vignettes/articles/metafor.R: -------------------------------------------------------------------------------- 1 | ## ---- include = FALSE--------------------------------------------------------- 2 | knitr::opts_chunk$set( 3 | collapse = TRUE, 4 | comment = "#>" 5 | ) 6 | 7 | ## ----setup, message=FALSE, warning=FALSE-------------------------------------- 8 | library(robvis) 9 | library(metafor) 10 | library(dplyr) 11 | 12 | # Define your studies, using the BCG dataset included in the metadat package 13 | dat_bcg <- metadat::dat.bcg 14 | 15 | glimpse(dat_bcg) 16 | 17 | # Create some example data for ROB2 using rob_dummy(), and add it to the BCG 18 | # data. 19 | # We don't need a "Study" column for this example, so we set `study = FALSE` 20 | 21 | dat_rob <- rob_dummy(13, 22 | "ROB2", 23 | study = FALSE) 24 | 25 | dat_analysis <- cbind(dat_bcg, dat_rob) 26 | 27 | glimpse(dat_analysis) 28 | 29 | ## ----------------------------------------------------------------------------- 30 | # Calculate effect estimates and sampling variances for each study 31 | dat_analysis <- 32 | metafor::escalc( 33 | measure = "RR", 34 | ai = tpos, 35 | bi = tneg, 36 | ci = cpos, 37 | di = cneg, 38 | data = dat_analysis 39 | ) 40 | 41 | # Perform the meta-analysis 42 | res <- metafor::rma(yi, 43 | vi, 44 | data = dat_analysis, 45 | slab = paste(author, year)) 46 | 47 | # Explore the results 48 | res 49 | 50 | ## ---- fig.width=10------------------------------------------------------------ 51 | rob_forest(res, rob_tool = "ROB2") 52 | 53 | -------------------------------------------------------------------------------- /vignettes/articles/metafor.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Working with metafor" 3 | author: "Luke A McGuinness" 4 | date: "`r Sys.Date()`" 5 | output: 6 | rmarkdown::html_document: 7 | toc: yes 8 | toc_depth: 4 9 | vignette: | 10 | %\VignetteIndexEntry{Working with metafor} 11 | %\VignetteEngine{knitr::rmarkdown} 12 | %\VignetteEncoding{UTF-8} 13 | --- 14 | 15 | ```{r, include = FALSE} 16 | knitr::opts_chunk$set( 17 | collapse = TRUE, 18 | comment = "#>" 19 | ) 20 | ``` 21 | 22 | `robvis` now provides some functionality to work with the results of meta-analyses performed using the [`metafor` package](https://wviechtb.github.io/metafor/index.html). 23 | 24 | First let's load the relevant packages and define our datasets: 25 | 26 | ```{r setup, message=FALSE, warning=FALSE} 27 | library(robvis) 28 | library(metafor) 29 | library(dplyr) 30 | 31 | # Define your studies, using the BCG dataset included in the metadat package 32 | dat_bcg <- metadat::dat.bcg 33 | 34 | glimpse(dat_bcg) 35 | 36 | # Create some example data for ROB2 using rob_dummy(), and add it to the BCG 37 | # data. 38 | # We don't need a "Study" column for this example, so we set `study = FALSE` 39 | 40 | dat_rob <- rob_dummy(13, 41 | "ROB2", 42 | study = FALSE) 43 | 44 | dat_analysis <- cbind(dat_bcg, dat_rob) 45 | 46 | glimpse(dat_analysis) 47 | ``` 48 | 49 | Now each row in the dataset contains a single numerical result and it's corresponding risk-of-bias assessment. 50 | 51 | ## Perform the meta-analysis 52 | 53 | Let's now perform a simple random-effects meta-analysis using `metafor::rma()`: 54 | 55 | ```{r} 56 | # Calculate effect estimates and sampling variances for each study 57 | dat_analysis <- 58 | metafor::escalc( 59 | measure = "RR", 60 | ai = tpos, 61 | bi = tneg, 62 | ci = cpos, 63 | di = cneg, 64 | data = dat_analysis 65 | ) 66 | 67 | # Perform the meta-analysis 68 | res <- metafor::rma(yi, 69 | vi, 70 | data = dat_analysis, 71 | slab = paste(author, year)) 72 | 73 | # Explore the results 74 | res 75 | ``` 76 | 77 | ## Create paired forest plot 78 | 79 | Having performed the meta-analysis, you can now append a risk-of-bias traffic-light plot onto the standard output from `metafor::forest()` by simply passing the results object (`res`) to `rob_forest()`: 80 | 81 | ```{r, fig.width=10} 82 | rob_forest(res, rob_tool = "ROB2") 83 | ``` 84 | 85 | This function is designed to make it as easy as possible to substitute `rob_forest()` for `metafor::forest()`. 86 | 87 | ## Risk of bias due to missing evidence 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | --------------------------------------------------------------------------------