Science Score: 26.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
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.8%) to scientific vocabulary
Keywords
r
Keywords from Contributors
package-creation
date-time
ropensci
tidy-data
Last synced: 10 months ago
·
JSON representation
Repository
The layout packages that powers ggplot2
Basic Info
- Host: GitHub
- Owner: r-lib
- License: other
- Language: R
- Default Branch: main
- Homepage: https://gtable.r-lib.org
- Size: 5.69 MB
Statistics
- Stars: 93
- Watchers: 11
- Forks: 18
- Open Issues: 1
- Releases: 8
Topics
r
Created over 14 years ago
· Last pushed about 1 year ago
Metadata Files
Readme
Changelog
License
Code of conduct
README.Rmd
---
output: github_document
---
```{r}
#| label: setup
#| include: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
set.seed(42L)
options(width = 90)
```
# gtable
[](https://github.com/r-lib/gtable/actions/workflows/R-CMD-check.yaml)
[](https://CRAN.R-project.org/package=gtable)
[](https://app.codecov.io/gh/r-lib/gtable)
[](https://lifecycle.r-lib.org/articles/stages.html#stable)
gtable is a layout engine built on top of the grid package. It is used to abstract away the creation of (potentially nested) grids of viewports into which graphic objects can be placed. gtable makes it easy to ensure alignment of graphic elements and piecemeal compositions of complex graphics. gtable is the layout engine powering [ggplot2](https://ggplot2.tidyverse.org) and is thus used extensively by many plotting functions in R without being called directly.
## Installation
You can install the released version of gtable from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("gtable")
```
or use the remotes package to install the development version from [GitHub](https://github.com/r-lib/gtable)
```r
# install.packages("pak")
pak::pak("r-lib/gtable")
```
## Example
ggplot2 uses gtable for laying out plots, and it is possible to access the gtable representation of a plot for inspection and modification:
```{r}
#| message: false
library(gtable)
library(ggplot2)
p <- ggplot(mtcars, aes(mpg, disp)) + geom_point()
p_table <- ggplotGrob(p)
p_table
```
A gtable object is a collection of graphic elements along with their placement in the grid and the dimensions of the grid itself. Graphic elements can span multiple rows and columns in the grid and be gtables themselves allowing for very complex automatically arranging layouts.
A gtable object is itself a grob, and can thus be drawn using standard functions from the grid package:
```{r}
#| fig-alt: >
#| A scatterplot of miles per gallon against displacement based on the mtcars
#| dataset. The plot is rendered by first converting the ggplot object to a
#| gtable and then plotting the gtable
library(grid)
grid.draw(p_table) # alternative use plot(p_table)
```
While most people will interact with gtable through ggplot2, it is possible to build a plot from the ground up.
```{r}
#| fig-alt: >
#| A scatterplot of random numbers. The scatterplot is created by combining
#| separate grobs created with grid using gtable.
# Construct some graphical elements using grid
points <- pointsGrob(
x = runif(10),
y = runif(10),
size = unit(runif(10), 'cm')
)
xaxis <- xaxisGrob(at = c(0, 0.25, 0.5, 0.75, 1))
yaxis <- yaxisGrob(at = c(0, 0.25, 0.5, 0.75, 1))
# Setup the gtable layout
plot <- gtable(
widths = unit(c(1.5, 0, 1, 0.5), c('cm', 'cm', 'null', 'cm')),
heights = unit(c(0.5, 1, 0, 1), c('cm', 'null', 'cm', 'cm'))
)
# Add the grobs
plot <- gtable_add_grob(
plot,
grobs = list(points, xaxis, yaxis),
t = c(2, 3, 2),
l = c(3, 3, 2),
clip = 'off'
)
# Plot
grid.draw(plot)
```
Owner
- Name: R infrastructure
- Login: r-lib
- Kind: organization
- Repositories: 154
- Profile: https://github.com/r-lib
GitHub Events
Total
- Create event: 3
- Release event: 1
- Issues event: 17
- Watch event: 6
- Delete event: 2
- Push event: 23
- Pull request event: 4
Last Year
- Create event: 3
- Release event: 1
- Issues event: 17
- Watch event: 6
- Delete event: 2
- Push event: 23
- Pull request event: 4
Committers
Last synced: 12 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| hadley | h****m@g****m | 85 |
| Winston Chang | w****n@s****g | 59 |
| Thomas Lin Pedersen | t****5@g****m | 50 |
| Kohske Takahashi @ jurina | t****e@g****m | 4 |
| Teun van den Brand | 4****d | 3 |
| Paul Murrell | p****l@s****z | 3 |
| Mara Averick | m****k@g****m | 2 |
| baptiste | b****e | 1 |
| R. Mark Sharp | r****p@m****m | 1 |
| Mikko Korpela | m****l@i****i | 1 |
| Brandon Hurr | b****r@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 58
- Total pull requests: 46
- Average time to close issues: about 3 years
- Average time to close pull requests: 9 months
- Total issue authors: 21
- Total pull request authors: 13
- Average comments per issue: 1.19
- Average comments per pull request: 2.22
- Merged pull requests: 33
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 4
- Pull requests: 4
- Average time to close issues: 2 days
- Average time to close pull requests: 3 days
- Issue authors: 2
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.5
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- hadley (15)
- thomasp85 (9)
- wch (9)
- baptiste (6)
- clauswilke (2)
- kohske (2)
- yingeddi2008 (1)
- jtoloe (1)
- fawda123 (1)
- raivokolde (1)
- mvaudel (1)
- pasipasi123 (1)
- ankhnesmerira (1)
- zaid-golwala (1)
- infotroph (1)
Pull Request Authors
- thomasp85 (21)
- teunbrand (7)
- kohske (6)
- wch (5)
- baptiste (4)
- batpigandme (2)
- rmsharp (1)
- retypepassword (1)
- ArtemSokolov (1)
- pmur002 (1)
- mvkorpel (1)
- bhive01 (1)
- Eli-Berkow (1)
Top Labels
Issue Labels
upkeep (3)
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- cran 746,575 last-month
- Total docker downloads: 201,298,206
-
Total dependent packages: 146
(may contain duplicates) -
Total dependent repositories: 679
(may contain duplicates) - Total versions: 13
- Total maintainers: 1
cran.r-project.org: gtable
Arrange 'Grobs' in Tables
- Homepage: https://gtable.r-lib.org
- Documentation: http://cran.r-project.org/web/packages/gtable/gtable.pdf
- License: MIT + file LICENSE
-
Latest release: 0.3.6
published over 1 year ago
Rankings
Downloads: 0.2%
Dependent repos count: 0.6%
Dependent packages count: 0.9%
Forks count: 4.2%
Stargazers count: 4.5%
Average: 4.6%
Docker downloads count: 17.3%
Maintainers (1)
Last synced:
11 months ago
conda-forge.org: r-gtable
- Homepage: https://gtable.r-lib.org
- License: MIT
-
Latest release: 0.3.1
published almost 4 years ago
Rankings
Dependent packages count: 1.9%
Dependent repos count: 3.8%
Average: 19.7%
Stargazers count: 35.6%
Forks count: 37.4%
Last synced:
10 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.0 depends
- grid * imports
- covr * suggests
- ggplot2 * suggests
- knitr * suggests
- profvis * suggests
- rmarkdown * suggests
- testthat * 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
.github/workflows/pr-commands.yaml
actions
- actions/checkout v3 composite
- r-lib/actions/pr-fetch v2 composite
- r-lib/actions/pr-push v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml
actions
- actions/checkout v3 composite
- actions/upload-artifact v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite