ggmosaic

Mosaicplots in the ggplot2 framework

https://github.com/haleyjeppson/ggmosaic

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 8 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.2%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Mosaicplots in the ggplot2 framework

Basic Info
Statistics
  • Stars: 167
  • Watchers: 12
  • Forks: 24
  • Open Issues: 29
  • Releases: 0
Created about 10 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog

README.Rmd

---
output: github_document
editor_options: 
  chunk_output_type: console
---



```{r include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  message=FALSE, warning=FALSE
)
```


[![CRAN Status](http://www.r-pkg.org/badges/version/ggmosaic)](https://cran.r-project.org/package=ggmosaic) [![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/ggmosaic)](https://www.r-pkg.org/pkg/ggmosaic) 
[![R-CMD-check](https://github.com/haleyjeppson/ggmosaic/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/haleyjeppson/ggmosaic/actions/workflows/R-CMD-check.yaml)

  
# ggmosaic 

ggmosaic was designed to create visualizations of categorical data and is capable of producing bar charts, stacked bar charts, mosaic plots, and double decker plots.

## Installation

You can install ggmosaic from github with:

```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("haleyjeppson/ggmosaic")
```

## Example

```{r example}
#| fig.alt: >
#|   Mosaicplot of survey participant's perceived health (from poor to excellent) given their
#|   financial situation relative to their peers. Perceived health generally increases with better
#|   financial situation.
library(ggmosaic)
library(dplyr)
happy %>% 
  mutate(finrela = forcats::fct_recode(finrela,
    "far below     " = "far below average",
    "    below" = "below average",
    "average" = "average",
    "above    " = "above average", 
    "l\n   far above" = "far above average")) %>% 
  ggplot() +
  geom_mosaic(aes(x = product(finrela), fill=health), show.legend = FALSE) +
  theme_mosaic() +
  scale_fill_manual(values = c("#4575B4", "#ABD9E9", "#FEE090", "#F46D43"))
```

## geom_mosaic: setting the aesthetics
 
In `geom_mosaic()`, the following aesthetics can be specified:

-   `weight`: select a weighting variable

-   `x`: select variables to add to formula

    -   declared as `x = product(var2, var1, ...)`

-   `alpha`: add an alpha transparency to the selected variable

    -   unless the variable is called in `x`, it will be added to the formula in the first position

-   `fill`: select a variable to be filled

    -   unless the variable is called in `x`, it will be added to the formula in the first position after the optional `alpha` variable.

-   `conds` : select a variable to condition on

    -   declared as `conds = product(cond1, cond2, ...)`

These values are then sent through repurposed `productplots` functions to create the desired formula: `weight ~ alpha + fill + x | conds`.

## Version compatibility issues with ggplot2

Since the initial release of ggmosaic, ggplot2 has evolved considerably. And as ggplot2 continues to evolve, ggmosaic must continue to evolve alongside it. Although these changes affect the underlying code and not the general usage of ggmosaic, the general user may need to be aware of compatibility issues that can arise between versions. The table below summarizes the compatibility between versions. 


| ggmosaic | ggplot2 | Axis labels                                                                   | Tick marks    |
|----------|---------|-------------------------------------------------------------------------------|---------------|
| [@93e5840](https://github.com/haleyjeppson/ggmosaic/commit/93e5840cc9586524428d36aeb8b33630341d20d7)    | 3.3.4   | x                                                                             | x     |
| 0.3.3    | 3.3.3   | x                                                                             | x             |
| 0.3.0    | 3.3.0   | x                                                                             | x             |
| 0.2.2    | 3.3.0   | Default labels are okay, but must use 
`scale_*_productlist()` to modify | No tick marks | | 0.2.2 | 3.2.0 | Default labels okay, but must use
`scale_*_productlist()` to modify | x | | 0.2.0 | 3.2.0 | Default labels are wrong, but can use
`labs()` to modify | x |

Owner

  • Name: Haley Jeppson
  • Login: haleyjeppson
  • Kind: user

GitHub Events

Total
  • Issues event: 6
  • Issue comment event: 2
  • Push event: 4
  • Pull request event: 2
  • Fork event: 4
Last Year
  • Issues event: 6
  • Issue comment event: 2
  • Push event: 4
  • Pull request event: 2
  • Fork event: 4

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 364
  • Total Committers: 8
  • Avg Commits per committer: 45.5
  • Development Distribution Score (DDS): 0.47
Past Year
  • Commits: 25
  • Committers: 2
  • Avg Commits per committer: 12.5
  • Development Distribution Score (DDS): 0.32
Top Committers
Name Email Commits
Haley Jeppson h****n@i****u 193
Heike Hofmann h****n@i****u 147
gregleleu g****u@g****m 6
earowang e****g@g****m 6
Haley Jeppson S****8@s****m 4
Vilmantas Gegzna G****V@g****m 4
Carson Sievert c****1@g****m 3
Matthias Grenié m****e@e****r 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 58
  • Total pull requests: 25
  • Average time to close issues: 10 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 51
  • Total pull request authors: 14
  • Average comments per issue: 2.64
  • Average comments per pull request: 0.56
  • Merged pull requests: 15
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 6
  • Average time to close issues: 13 minutes
  • Average time to close pull requests: N/A
  • Issue authors: 5
  • Pull request authors: 4
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.83
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rmcd1024 (2)
  • larmarange (2)
  • rpruim (2)
  • jennybc (2)
  • GegznaV (2)
  • shippy (2)
  • friendly (2)
  • nickvence (1)
  • moxboxwa (1)
  • rcorty (1)
  • nyambea (1)
  • paulb20 (1)
  • lucazav (1)
  • under-score (1)
  • ndrubins (1)
Pull Request Authors
  • haleyjeppson (7)
  • gregleleu (3)
  • m7pr (2)
  • nalimilan (2)
  • cpsievert (2)
  • teunbrand (2)
  • olivroy (2)
  • earowang (1)
  • ian-curtis (1)
  • Rekyt (1)
  • heike (1)
  • GegznaV (1)
  • MichaelChirico (1)
  • rmcd1024 (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 3,811 last-month
  • Total docker downloads: 335
  • Total dependent packages: 5
    (may contain duplicates)
  • Total dependent repositories: 27
    (may contain duplicates)
  • Total versions: 5
  • Total maintainers: 1
cran.r-project.org: ggmosaic

Mosaic Plots in the 'ggplot2' Framework

  • Versions: 4
  • Dependent Packages: 5
  • Dependent Repositories: 26
  • Downloads: 3,811 Last month
  • Docker Downloads: 335
Rankings
Stargazers count: 2.5%
Forks count: 4.4%
Dependent repos count: 5.4%
Downloads: 6.0%
Average: 8.9%
Dependent packages count: 10.9%
Docker downloads count: 24.0%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: r-ggmosaic
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.3%
Stargazers count: 28.6%
Average: 36.0%
Forks count: 39.5%
Dependent packages count: 51.6%
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • ggplot2 >= 3.3.0 depends
  • dplyr * imports
  • ggrepel * imports
  • plotly >= 4.5.5 imports
  • productplots * imports
  • purrr * imports
  • rlang * imports
  • scales * imports
  • tidyr * imports
  • NHANES * suggests
  • gridExtra * suggests
  • knitr * suggests
  • patchwork * suggests
  • rmarkdown * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite