gggap
Streamlined creation of segments on the y-axis of 'ggplot2' plots
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.5%) to scientific vocabulary
Keywords
Repository
Streamlined creation of segments on the y-axis of 'ggplot2' plots
Basic Info
Statistics
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 3
- Releases: 0
Topics
Metadata Files
README.md
gggap
Easily create segments in the y-axis of a 'ggplot2' plot.
This project builds on top of gg.gap v1.4 by Jiacheng Lou, et al.
What changed with respect to upstream?
- Improved handling of subtitles and captions. These were duplicated and placed in the gap between the new segments of the plot.
- Legends are now supported by the core functionality.
- The code was heavily refactored following the tidyverse style guide and Clean Code principles.
- The project has a new name after lossing the punctuation mark from the former name as per the recommendations of the style guide.
Installation
You can install gggap from CRAN:
r
install.packages("gggap")
A development version can be retrieved from Github:
``` r
install.packages("devtools")
devtools::install_github("cmoralesmx/gggap", ref="dev") ```
How to use gggap
``` r data(mtcars) library(ggplot2) p <- ggplot(data = mtcars, aes(x = gear, fill = gear)) + geom_bar() + ggtitle("Number of Cars by Gears") + xlab("Gears")
single segments and missing tick_width
gggap(plot = p, segments = c(5, 10), ylim = c(0, 50))
tick_width can be one or more numbers
gggap( plot = p, segments = c(5, 10), tick_width = c(1, 10), ylim = c(0, 50) )
segments list cantains more than one number vectors
gggap( plot = p, segments = list(c(2.5, 4),c(5, 10)), tick_width = c(1, 0.5, 10), ylim = c(0, 50))
rel_heights can set the relative height for segments and segmented y-axis
gggap( plot = p, segments = list(c(2.5, 4),c(5, 10)), tickwidth = c(1, 0.5, 10), relheights = c(0.2, 0, 0.2, 0,1), ylim = c(0, 50) )
reversed y-axis
p <- ggplot( data = mtcars, aes(x = gear, fill = gear) ) + geombar() + ggtitle("Number of Cars by Gears") + xlab("Gears")+ scaley_continuous(trans = 'reverse')
single segments and missing tick_width
gggap(plot = p, segments = c(10, 5), ylim = c(15, 0))
for facet()
library(ggplot2) p <- ggplot(mtcars, aes(mpg, hp)) + geompoint() p1 <- p + facetwrap(~cyl, scales = "free") gggap(plot = p1, ylim = c(60, 200), segments = c(100, 120)) ```
Owner
- Name: Carlos Morales
- Login: cmoralesmx
- Kind: user
- Location: Morelos, Mexico
- Website: https://cm-cloudarchitect.com
- Repositories: 3
- Profile: https://github.com/cmoralesmx
GitHub Events
Total
- Issues event: 1
Last Year
- Issues event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Carlos Morales | c****7@g****m | 14 |
| Chris Lou | 3****o | 6 |
Issues and Pull Requests
Last synced: over 2 years ago
All Time
- Total issues: 4
- Total pull requests: 0
- Average time to close issues: 11 minutes
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- cmoralesmx (4)
- d-cg-b (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 213 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
cran.r-project.org: gggap
Streamlined Creation of Segments on the Y-Axis of 'ggplot2' Plots
- Homepage: https://github.com/cmoralesmx/gggap
- Documentation: http://cran.r-project.org/web/packages/gggap/gggap.pdf
- License: GPL-3
-
Latest release: 1.0.1
published over 5 years ago