introdataviz
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
✓DOI references
Found 2 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
1 of 4 committers (25.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.9%) to scientific vocabulary
Keywords
dataviz
education
ggplot2
Last synced: 4 months ago
·
JSON representation
·
Repository
Basic Info
- Host: GitHub
- Owner: PsyTeachR
- License: other
- Language: TeX
- Default Branch: master
- Homepage: https://psyteachr.github.io/introdataviz/
- Size: 67 MB
Statistics
- Stars: 46
- Watchers: 4
- Forks: 12
- Open Issues: 7
- Releases: 0
Topics
dataviz
education
ggplot2
Created over 4 years ago
· Last pushed almost 2 years ago
Metadata Files
Readme
Changelog
License
Citation
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(dplyr)
library(ggplot2)
```
# introdataviz
## Installation
You can install introdataviz with:
``` r
# you may have to install devtools first with
# install.packages("devtools")
devtools::install_github("psyteachr/introdataviz")
```
```{r}
library(introdataviz)
```
## Workbook functions
Open a local copy of the book:
``` r
introdataviz::book()
```
Save the workbook and data file to your working directory and open the workbook in RStudio:
``` r
introdataviz::workbook()
```
## Data functions
`ldt_data` is the main data set we use in the tutorials. It is simulated stroop task data for monolingual and bilingual participants. DVs are mean reaction time (rt) and accuracy (acc) for words and non-words.
```{r, echo = FALSE, results='asis'}
head(ldt_data) %>% knitr::kable()
```
`ldt_long` is `ldt_data` converted to a different (longer) format for plotting and converting the numeric value for `language` into words.
```{r, echo = FALSE, results='asis'}
head(ldt_long) %>% knitr::kable()
```
## Plotting functions
This package also provides two functions (`geom_split_violin()` and `geom_flat_violin()`) used to make split-violin and raincloud plots (modified from code by [Allen et al., 2021](https://doi.org/10.12688/wellcomeopenres.15191.2)).
### Split-violin plots
Split-violin plots remove the redundancy of mirrored violin plots and make it easier to compare the distributions between multiple conditions.
```{r splitviolin, fig.cap = "Split-violin plot"}
colours <- c("dodgerblue2", "darkorange")
ggplot(ldt_long, aes(x = condition, y = rt, fill = language)) +
introdataviz::geom_split_violin(alpha = .4) +
geom_boxplot(width = .2, alpha = .6, show.legend = FALSE) +
stat_summary(fun.data = "mean_se", geom = "pointrange", show.legend = F,
position = position_dodge(.175)) +
scale_x_discrete(name = "Condition", labels = c("Non-word", "Word")) +
scale_y_continuous(name = "Reaction time (ms)") +
scale_fill_manual(values = colours, name = "Language group") +
theme_minimal()
```
### Raincloud plots
Raincloud plots combine a density plot, boxplot, raw data points, and any desired summary statistics for a complete visualisation of the data. They are so called because the density plot plus raw data is reminiscent of a rain cloud.
```{r raincloud, fig.cap="Raincloud plot"}
rain_height <- .1
ggplot(ldt_long, aes(x = "", y = rt, fill = language)) +
# clouds
introdataviz::geom_flat_violin(trim=FALSE, alpha = 0.4,
position = position_nudge(x = rain_height+.05)) +
# rain
geom_point(aes(colour = language), size = 2, alpha = .5, show.legend = FALSE,
position = position_jitter(width = rain_height, height = 0)) +
# boxplots
geom_boxplot(width = rain_height, alpha = 0.5, show.legend = FALSE,
outlier.shape = NA,
position = position_nudge(x = -rain_height*2)) +
# mean and SE point in the cloud
stat_summary(fun.data = mean_se, mapping = aes(color = language), show.legend = FALSE,
position = position_nudge(x = rain_height * 3)) +
# adjust layout
scale_x_discrete(name = "", expand = c(rain_height*3, 0, 0, 0.7)) +
scale_y_continuous(name = "Reaction time (ms)",
breaks = seq(200, 800, 100),
limits = c(200, 800)) +
coord_flip() +
facet_wrap(~factor(condition,
levels = c("word", "nonword"),
labels = c("Words", "Non-Words")),
nrow = 2) +
# custom colours and theme
scale_fill_manual(values = colours, name = "Language group") +
scale_colour_manual(values = colours) +
theme_minimal() +
theme(panel.grid.major.y = element_blank(),
legend.position = c(0.8, 0.8),
legend.background = element_rect(fill = "white", color = "white"))
```
Owner
- Name: psyTeachR
- Login: PsyTeachR
- Kind: organization
- Location: Glasgow, Scotland
- Website: https://psyteachr.github.io
- Repositories: 19
- Profile: https://github.com/PsyTeachR
Teaching Reproducible Psychology
Citation (CITATION)
cff-version: 1.2.0 message: "If you use this paper, please cite it as below." authors: - family-names: "Nordmann" given-names: "Emily" orcid: "https://orcid.org/0000-0002-0806-1081" - family-names: "McAleer" given-names: "Phil" orcid: "https://orcid.org/0000-0002-4523-2097" - family-names: "Toivo" given-names: "Wilhelmiina" orcid: "https://orcid.org/0000-0002-5688-9537" - family-names: "Paterson" given-names: "Helena" orcid: "https://orcid.org/0000-0001-7715-5973" - family-names: "Lisa" given-names: "DeBruine" orcid: "https://orcid.org/0000-0002-7523-5539" title: "Data visualisation using R, for researchers who don't use R" year: 2021 doi: https://doi.org/10.31234/osf.io/4huvw version: 2.0. date-released: 2021-09-17 url: "https://github.com/psyteachr/introdataviz/"
GitHub Events
Total
- Watch event: 9
- Issue comment event: 3
- Pull request event: 2
- Fork event: 1
Last Year
- Watch event: 9
- Issue comment event: 3
- Pull request event: 2
- Fork event: 1
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| debruine | d****e@g****m | 30 |
| emilynordmann | e****n@g****m | 12 |
| wtoivo | w****o@g****m | 1 |
| John Little | j****e@d****u | 1 |
Committer Domains (Top 20 + Academic)
duke.edu: 1
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 5
- Total pull requests: 6
- Average time to close issues: 13 minutes
- Average time to close pull requests: 22 days
- Total issue authors: 2
- Total pull request authors: 4
- Average comments per issue: 1.2
- Average comments per pull request: 0.17
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 3
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- debruine (3)
- OscarLecuona (2)
Pull Request Authors
- gungorMetehan (3)
- libjohn (1)
- wtoivo (1)
- FeelLiao (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
DESCRIPTION
cran
- R >= 2.10 depends
- broom * imports
- downlit * imports
- dplyr * imports
- ggalluvial * imports
- ggplot2 * imports
- ggridges * imports
- glossary * imports
- grid * imports
- knitr * imports
- papaja * imports
- patchwork * imports
- plyr * imports
- readr * imports
- scales * imports
- tidyr * imports
- webexercises * imports