Skip to contents

shinyDigitise logo

[!IMPORTANT] You are viewing the development branch. It has new features and bug fixes that are not yet in the stable version on master, including typed sample sizes for scatterplots and histograms, log axes, step-by-step checks, and fixes for editing groups and reopening figures. See what’s new and fixed and how to install either version.

shinyDigitise builds upon the popular metaDigitise package and provides users with an interactive UI to help extraction of data from five different plot types. The main functions used in shinyDigitise are called from the metaDigitise package, which allows users to extract descriptive statistics from various plot types.

A large share of the effect sizes in any meta-analysis are read off figures in the primary literature, and that step is usually undocumented, unarchived, and impossible to check. Importantly, both packages allow for replotting and checking of data extraction from graphs — which all contribute to increased reproducibility. The app walks you through calibration and point selection, keeps the calibration data alongside the extracted values, and can redraw your extraction over the original image so errors are visible rather than silent.

Now published in Research Synthesis Methods.

Features

  • Five plot types. Mean/error, boxplot, xy mean/error, histogram, and scatterplot. xy mean/error is only offered when the installed metaDigitise supports it (see Installation).
  • Log axes. Boxplots and scatterplots can have a log-transformed or log-stretched axis, in any base. For scatterplots this is the x or the y axis, not both.
  • Guided, six-stage workflow. The app walks you through each stage in order.
  • Live orientation and calibration. Flip or rotate a figure with the rotation angle shown on screen, then set the axes by double-clicking.
  • Zoom and adjust on the fly. Click and drag a box over any area and press Zoom to zoom in, and adjust point size and group label positions as you work.
  • Replot and check. Extractions can be redrawn over the source figure, so mistakes are caught rather than archived.
  • Deliberately manual. Semi-automated point detection makes users complacent and introduces errors that are hard to spot; extraction here is your judgement, recorded so others can check it.
  • Output you can archive. Each figure’s calibration and clicks are saved (as RDS-format files named after each image, with no file extension, in a caldat/ folder inside the image folder), so an extraction can be reopened and checked later. The extracted values are returned as a data frame and saved as ExtractedData.csv in the image folder.
  • Compatible with metaDigitise. The extracted values are identical to metaDigitise’s. Figures saved by shinyDigitise can be plotted, summarised and edited in metaDigitise, and figures digitised in metaDigitise can be reopened in shinyDigitise.

Installation

shinyDigitise is not on CRAN. There are two versions:

Stable version (the master branch):

install.packages("pak")
pak::pak("EIvimeyCook/shinyDigitise")

Development version (the development branch), with the latest features and bug fixes (what’s new and fixed):

pak::pak("EIvimeyCook/shinyDigitise@development")

To check which version you have, run packageVersion("shinyDigitise"): 0.1.0 is the stable version and 0.1.1 the development version. To switch between them, run the other install command.

If you plan on using shinyDigitise to extract data from xy mean graphs, you need the GitHub version of metaDigitise. The xy mean/error option only appears in the app when the installed metaDigitise can process it, because otherwise those figures could not be exported.

pak::pak("joelpick/metaDigitise")

There is a known bug with some versions of RStudio (https://github.com/rstudio/rstudio/issues/12649). Be sure to update RStudio to the latest version.

Usage

Video tutorial here.

library(shinyDigitise)
df <- shinyDigitise("folder where your images are located")

or — where you specify the folder through a menu system within SD:

Basic workflow

The app will walk you through each stage. If a directory is provided, you’ll skip straight to the file selection phase. If not, you’ll be asked to select any image file inside the image folder, and that folder is then used.

  1. Choose plot type — mean/error, boxplot, xy mean/error, histogram, or scatterplot.
  2. Orientate figure — flip or rotate the graph (rotation angle is shown on screen).
  3. Calibrate axes — click calibrate mode on, and, depending on the plot type shown, double click on the axes in the relevant order and add the variable name and values. These will then appear on the plot (the size will depend on the point size slider). For boxplots and scatterplots, also say whether any axis is on a log scale, whether it is transformed (the labels are logged values) or stretched (the labels are raw values on a log-spaced axis), and the log base.
  4. Add groups — clicking add group will cause a pop up to appear to enter data (name and sample size). This will then appear in the table. Histograms are the exception: they have a single group, Group1, created for you, so enter the sample size through Edit Group Info. Clicking the group will allow you to either double click points on the graph (you have to press the click points button first) or delete the group. For a mean/error graph, select the type of error shown (SE, SD or 95% CI); this is required.
  5. Comments — add a comment to your data.
  6. Finished! The app will close when you’ve reached the end of your graphs.

Before a figure is saved, the app checks it is complete. It checks that:

  • every axis value is a number;
  • each mean/error group has exactly 2 clicks (3 for xy mean/error) and an error type is selected;
  • each boxplot group has 5 clicks;
  • each histogram has 2 clicks per bar.

If anything is missing, the app tells you what and takes you back to that step. Nothing you have entered is lost.

If you move or rename the image folder, figures you have already digitised still reopen from the new location.

To view the extracted data just simply call the object you’ve created or view the resulting .csv file (which will be saved into the same folder as the images). If a saved figure cannot be processed, it is skipped with a warning that names it, and the other figures are still exported. If you close the app without digitising anything, nothing is exported and NULL is returned.

Tip. You can adjust point size and group name positions on the fly, as well as zoom in on the image by clicking and dragging a box over the desired area and pressing Zoom (press Zoom again with no box drawn to reset).

Note on sample sizes. Always check the exported sample size against the expected sample size. The sample size you enter for a group is the n in the exported data for every plot type. Enter it when adding a group or, for histograms (which have no add group step), through Edit Group Info. For scatterplots and histograms, if you leave it blank, n is estimated from your clicks instead: the number of points clicked in each group (scatterplots) or the total of the bar heights (histograms).

Versions up to 0.1.0 always exported the clicked estimate for scatterplots and histograms, even when a sample size was typed. To correct an older extraction, open that figure in version 0.1.1 or later, check the sample size in the group table (scatterplot sample sizes typed when adding a group were saved and reappear; histogram ones were not), enter or correct it with Edit Group Info, and press Continue. Versions up to 0.1.0 also removed a group’s points when you re-digitised or deleted another group whose name contained it (e.g. “males” and “females”), so please re-check extractions with group names like these.

Bug reports and contributions

Please file issues and feature requests at https://github.com/EIvimeyCook/shinyDigitise/issues. Pull requests are welcome.

Before reporting a bug, please install the development version (see Installation) and check whether the problem is still there. Many bugs are already fixed on the development branch; they are listed in NEWS.md. When you file an issue, please include the output of packageVersion("shinyDigitise") and sessionInfo().

Citation

Please cite both shinyDigitise and metaDigitise:

Ivimey-Cook, E. R., Noble, D. W. A., Nakagawa, S., Lajeunesse, M. J., & Pick, J. L. (2023). Advice for improving the reproducibility of data extraction in meta-analysis. Research Synthesis Methods, 14(6), 911–915. https://doi.org/10.1002/jrsm.1663

Pick, J. L., Nakagawa, S., & Noble, D. W. A. (2019). Reproducible, flexible and high-throughput data extraction from primary literature: The metaDigitise R package. Methods in Ecology and Evolution, 10(3), 426–431. https://doi.org/10.1111/2041-210X.13118

A machine-readable CITATION.cff is included, so GitHub’s “Cite this repository” button gives formatted APA and BibTeX.

Contact

Edward R. Ivimey-Cook — — ORCID 0000-0003-4910-0443

License

Released under the MIT License.