Skip to content

Commit

Permalink
fixing changes highlighted by Jessica & Lusia
Browse files Browse the repository at this point in the history
  • Loading branch information
njudd committed Jul 8, 2024
1 parent 487bdac commit 1a3c4ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ bibliography: inst/references.bib

# Summary

Clear data visualization is essential to effectively communicate empirical findings across various research fields. Raincloud plots fill this need by offering a transparent and statistically robust approach to data visualization [@allen2021raincloud]. This is achieved by combining three plots in an aesthetically pleasing fashion. First, a dot plot displays raw data with minimal distortion, allowing a fast glance at the sample size and outlier identification. Next, a box plot displays key distributional summary statistics such as the median and interquartile range. Lastly, a violin plot transparently displays the underlying distribution of the data. Despite the widespread use of raincloud plots, an R-package in alignment with the ‘grammar of graphics’ [@wilkinson2012grammar, @ggplot2] was lacking. `ggrain` fills this need by offering one easy-to-use function (`geom_rain`) allowing the quick and seamless plotting of rainclouds in the R ecosystem. Further, it enables more complex plotting features such as factorial grouping, mapping with a secondary (continuous) covariate, and connecting observations longitudinally across multiple waves.
Clear data visualization is essential to effectively communicate empirical findings across various research fields. Raincloud plots fill this need by offering a transparent and statistically robust approach to data visualization [@allen2021raincloud]. This is achieved by combining three plots in an aesthetically pleasing fashion. First, a dot plot displays raw data with minimal distortion, allowing a quick glance at the sample size and outlier identification. Next, a box plot displays key distributional summary statistics such as the median and interquartile range. Lastly, a violin plot transparently displays the underlying distribution of the data. Despite the widespread use of raincloud plots, an R package in alignment with the ‘grammar of graphics’ was lacking [@wilkinson2012grammar; @ggplot2]. `ggrain` fills this need by offering one easy-to-use function (`geom_rain`) allowing the quick and seamless plotting of rainclouds in the R ecosystem. Further, it enables more complex plotting features such as factorial grouping, mapping with a secondary (continuous) covariate, and connecting observations longitudinally across multiple waves.

# Statement of need

Done well, data visualization is one of the single most powerful ways in which scientists can communicate messages. However, through force of habit or conventions, researchers commonly use visualisation methods like the barplot, which removes the distributional properties of underlying data. Bar plots are sensitive to distortion, unable to accurately represent the raw data, and do not display potential differences in distributions. For these reasons, they can lead to misinterpretation about the magnitudes of statistical differences between samples [@weissgerber2015beyond] and are commonly criticized for being a non-transparent means to visualize data.

To overcome these challenges, we developed ‘raincloud plots’ [@allen2021raincloud] in which we tried to address these problems in an intuitive, modular, and statistically robust format (Figure 1). In essence, raincloud plots combine a ‘split-half violin’ (an un-mirrored Probability Density Function plotted against the redundant data axis), raw jittered data points, and a boxplot for standard visualization of the median and interquartile range. The combination of these plots allows maximal statistical information at a glance. Raincloud plots were very well received by the academic community, being in the top 5% of all research outputs scored by Altmetric, having more than 1000 GitHub stars, along with integration in popular statistical open-source software (Cf., [https://jasp-stats.org/2021/10/05/raincloud-plots-innovative-data-visualizations-in-jasp/](!https://jasp-stats.org/2021/10/05/raincloud-plots-innovative-data-visualizations-in-jasp/)) [@love2019jasp].
To overcome these challenges, we developed ‘raincloud plots’ [@allen2021raincloud] that aims to address these problems in an intuitive, modular, and statistically robust format (Figure 1). In essence, raincloud plots combine a ‘split-half violin’ (an un-mirrored Probability Density Function plotted against the redundant data axis), raw jittered data points, and a boxplot for standard visualization of the median and interquartile range. The combination of these plots allows maximal statistical information at a glance. Raincloud plots were very well received by the academic community, being in the top 5% of all research outputs scored by Altmetric, having more than 1000 GitHub stars, along with integration in popular statistical open-source software (Cf., [https://jasp-stats.org/2021/10/05/raincloud-plots-innovative-data-visualizations-in-jasp/](!https://jasp-stats.org/2021/10/05/raincloud-plots-innovative-data-visualizations-in-jasp/)) [@love2019jasp].

However, a robust and validated R-package was lacking.Therefore, we developed 'ggrain' allowing researchers in the R programming language [@rCore] to create raincloud plots in an easy and logical fashion. In `ggrain`, every plotting element:

Expand All @@ -70,7 +70,7 @@ As with the wider raincloud plots framework [@allen2021raincloud], our goal with

**ggrain** is available on CRAN [https://cran.r-project.org/web/packages/ggrain/index.html](!https://cran.r-project.org/web/packages/ggrain/index.html). The `geom_rain` function is a combination of 4 different geom functions (i.e., `geom_point`, `geom_line`, `geom_boxplot` & `geom_half_violin`). The following four higher-level convenience arguments allow major changes to the raincloud:

- `id.long.var`: a grouping variable to connect the lines by
- `id.long.var`: a grouping variable to connect the lines
- `cov`: a covariate to remap the color of the points
- `likert`: True or False response which adds y jittering
- `rain.side`: Which side to display the rainclouds: 'l' for left, 'r' for right and 'f' for flanking
Expand All @@ -82,14 +82,14 @@ Position-related arguments (e.g., jittering, nudging & width) can be passed with

For detailed usage examples see the vignette [https://www.njudd.com/raincloud-ggrain/](!https://www.njudd.com/raincloud-ggrain/).

**ggrain** requires the **ggplot2** [@ggplot2] to build `geom_rain` which follows the grammar of the graphics framework. The gghalves package is extensively used for their half `geom_half_violin` function [@gghalves]. ggpp is used for their combination of jitter and nudging for points [@ggpp]. Other dependencies include grid, rlang, vctrs & cli [@grid; @rlang; @vctrs; @cli].
**ggrain** requires the **ggplot2** package [@ggplot2] to build `geom_rain` which follows the grammar of the graphics framework. The `gghalves` package is extensively used for their half `geom_half_violin` function [@gghalves]. `ggpp` is used for their combination of jitter and nudging for points [@ggpp]. Other dependencies include `grid`, `rlang`, `vctrs` & `cli` [@rCore; @rlang; @vctrs; @cli].

![Two example figures from **ggrain**: *a)* a grouped raincloud and *b)* a grouped repeated measures raincloud. Source code how to create these figures is available at: [https://github.com/njudd/ggrain/blob/main/inst/JOSS_figures.R](!https://github.com/njudd/ggrain/blob/main/inst/JOSS_figures.R).
](inst/git_pics/Pub_Fig.png)

# Acknowledgements

This project was supported by the Open Science Fund from the Dutch research council (Nederlandse Organisatie voor Wetenschappelijk Onderzoek, NWO, file number: 203.001.011). First we would like to acknowledge the coining of the name ‘raincloud plots’ by Jon Roiser on March 15, 2018. We also would like to thank all participants in our in-person and online raincloud plots workshops, as their feedback has considerably improved our package. Finally, we would like to thank everyone who has ever used raincloud plots in their work, shared or advocated our work on social media, submitted bug reports or issues, and provided kind suggestions on how to improve our software. The ‘ggrain’ R-package is more robust, user-friendly, and intuitive because of them.
This project was supported by the Open Science Fund from the Dutch research council (Nederlandse Organisatie voor Wetenschappelijk Onderzoek, NWO, file number: 203.001.011). First we would like to acknowledge the coining of the name ‘raincloud plots’ by Jon Roiser on March 15, 2018. We also would like to thank all participants in our in-person and online raincloud plots workshops, as their feedback has considerably improved our package. We also thank Luisa Fassi & Jessica Schaaf for reviewing this manuscript. Finally, we would like to thank everyone who has ever used raincloud plots in their work, shared or advocated our work on social media, submitted bug reports or issues, and provided kind suggestions on how to improve our software. The ‘ggrain’ R-package is more robust, user-friendly, and intuitive because of them.

# References

Expand Down

0 comments on commit 1a3c4ee

Please sign in to comment.