diff --git a/dev/news/index.html b/dev/news/index.html
index 25c4a0c..261f13d 100644
--- a/dev/news/index.html
+++ b/dev/news/index.html
@@ -39,6 +39,7 @@
gtable (development version)
gtable 0.3.5
CRAN release: 2024-04-22
diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml
index 5171626..e617a37 100644
--- a/dev/pkgdown.yml
+++ b/dev/pkgdown.yml
@@ -3,7 +3,7 @@ pkgdown: 2.1.1
pkgdown_sha: ~
articles:
profiling: profiling.html
-last_built: 2024-10-25T10:09Z
+last_built: 2024-10-25T10:29Z
urls:
reference: https://gtable.r-lib.org/reference
article: https://gtable.r-lib.org/articles
diff --git a/dev/reference/gtable.html b/dev/reference/gtable.html
index 592dd07..52fcab0 100644
--- a/dev/reference/gtable.html
+++ b/dev/reference/gtable.html
@@ -87,8 +87,7 @@
Argumentsrownames, colnames
character vectors of row and column names, used
-for characteric subsetting, particularly for gtable_align
,
-and gtable_join
.
+for characteric subsetting.
vp
diff --git a/dev/search.json b/dev/search.json
index 905f05c..fb02eac 100644
--- a/dev/search.json
+++ b/dev/search.json
@@ -1 +1 @@
-[{"path":[]},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@posit.co. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://gtable.r-lib.org/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 gtable authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://gtable.r-lib.org/dev/articles/profiling.html","id":"performance-focused-changes-across-versions","dir":"Articles","previous_headings":"","what":"Performance focused changes across versions","title":"Profiling Performance","text":"keep track changes focused improving performance gtable summarised :","code":""},{"path":"https://gtable.r-lib.org/dev/articles/profiling.html","id":"v0-3-5-9000","dir":"Articles","previous_headings":"Performance focused changes across versions","what":"v0.3.5.9000","title":"Profiling Performance","text":"Profiling results gtable v0.2.0 identified range areas easily improved fairly small code changes. changes resulted roughly 20% decrease running time profiling code general, gtable related functions 50 80% decrease running time specifically. data.frame construction indexing. gtable now includes minimal constructor makes input checking used working layout data frame. , indexing layout data frame improved either treating list internally directly calling .subset2 Input validation. stopifnot() identified bottleneck removed favor standard (...) stop() Dimension querying. use nrow() ncol() internally substituted direct calls length() heights widths unit vectors","code":""},{"path":"https://gtable.r-lib.org/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Hadley Wickham. Author. Thomas Lin Pedersen. Author, maintainer. . Copyright holder, funder.","code":""},{"path":"https://gtable.r-lib.org/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Wickham H, Pedersen T (2024). gtable: Arrange 'Grobs' Tables. R package version 0.3.5.9000, https://github.com/r-lib/gtable, https://gtable.r-lib.org.","code":"@Manual{, title = {gtable: Arrange 'Grobs' in Tables}, author = {Hadley Wickham and Thomas Lin Pedersen}, year = {2024}, note = {R package version 0.3.5.9000, https://github.com/r-lib/gtable}, url = {https://gtable.r-lib.org}, }"},{"path":"https://gtable.r-lib.org/dev/index.html","id":"gtable-","dir":"","previous_headings":"","what":"Arrange Grobs in Tables","title":"Arrange Grobs in Tables","text":"gtable layout engine built top grid package. used abstract away creation (potentially nested) grids viewports graphic objects can placed. gtable makes easy ensure alignment graphic elements piecemeal compositions complex graphics. gtable layout engine powering ggplot2 thus used extensively many plotting functions R without called directly.","code":""},{"path":"https://gtable.r-lib.org/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Arrange Grobs in Tables","text":"can install released version gtable CRAN : use remotes package install development version GitHub","code":"install.packages(\"gtable\") # install.packages(\"pak\") pak::pak(\"r-lib/gtable\")"},{"path":"https://gtable.r-lib.org/dev/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Arrange Grobs in Tables","text":"ggplot2 uses gtable laying plots, possible access gtable representation plot inspection modification: gtable object collection graphic elements along placement grid dimensions grid . Graphic elements can span multiple rows columns grid gtables allowing complex automatically arranging layouts. gtable object grob, can thus drawn using standard functions grid package: people interact gtable ggplot2, possible build plot ground .","code":"library(gtable) library(ggplot2) p <- ggplot(mtcars, aes(mpg, disp)) + geom_point() p_table <- ggplotGrob(p) p_table #> TableGrob (16 x 13) \"layout\": 22 grobs #> z cells name grob #> 1 0 ( 1-16, 1-13) background rect[plot.background..rect.38] #> 2 5 ( 8- 8, 6- 6) spacer zeroGrob[NULL] #> 3 7 ( 9- 9, 6- 6) axis-l absoluteGrob[GRID.absoluteGrob.26] #> 4 3 (10-10, 6- 6) spacer zeroGrob[NULL] #> 5 6 ( 8- 8, 7- 7) axis-t zeroGrob[NULL] #> 6 1 ( 9- 9, 7- 7) panel gTree[panel-1.gTree.17] #> 7 9 (10-10, 7- 7) axis-b absoluteGrob[GRID.absoluteGrob.22] #> 8 4 ( 8- 8, 8- 8) spacer zeroGrob[NULL] #> 9 8 ( 9- 9, 8- 8) axis-r zeroGrob[NULL] #> 10 2 (10-10, 8- 8) spacer zeroGrob[NULL] #> 11 10 ( 7- 7, 7- 7) xlab-t zeroGrob[NULL] #> 12 11 (11-11, 7- 7) xlab-b titleGrob[axis.title.x.bottom..titleGrob.30] #> 13 12 ( 9- 9, 5- 5) ylab-l titleGrob[axis.title.y.left..titleGrob.33] #> 14 13 ( 9- 9, 9- 9) ylab-r zeroGrob[NULL] #> 15 14 ( 9- 9,11-11) guide-box-right zeroGrob[NULL] #> 16 15 ( 9- 9, 3- 3) guide-box-left zeroGrob[NULL] #> 17 16 (13-13, 7- 7) guide-box-bottom zeroGrob[NULL] #> 18 17 ( 5- 5, 7- 7) guide-box-top zeroGrob[NULL] #> 19 18 ( 9- 9, 7- 7) guide-box-inside zeroGrob[NULL] #> 20 19 ( 4- 4, 7- 7) subtitle zeroGrob[plot.subtitle..zeroGrob.35] #> 21 20 ( 3- 3, 7- 7) title zeroGrob[plot.title..zeroGrob.34] #> 22 21 (14-14, 7- 7) caption zeroGrob[plot.caption..zeroGrob.36] library(grid) grid.draw(p_table) # alternative use plot(p_table) # 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)"},{"path":"https://gtable.r-lib.org/dev/reference/as.gtable.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a gtable — as.gtable","title":"Convert to a gtable — as.gtable","text":"Convert gtable","code":""},{"path":"https://gtable.r-lib.org/dev/reference/as.gtable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a gtable — as.gtable","text":"","code":"as.gtable(x, ...) # S3 method for class 'grob' as.gtable(x, widths = NULL, heights = NULL, ...)"},{"path":"https://gtable.r-lib.org/dev/reference/as.gtable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a gtable — as.gtable","text":"x object convert. ... Arguments forwarded methods. widths, heights Scalar unit setting size table. Defaults grid::grobWidth() grid::grobHeight() x respectively.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/as.gtable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to a gtable — as.gtable","text":"gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/as.gtable.html","id":"methods-by-class-","dir":"Reference","previous_headings":"","what":"Methods (by class)","title":"Convert to a gtable — as.gtable","text":".gtable(grob): Creates 1-cell gtable containing grob.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/bind.html","id":null,"dir":"Reference","previous_headings":"","what":"Row and column binding for gtables. — bind","title":"Row and column binding for gtables. — bind","text":"functions parallels matrix/data.frame row column bindings. work way, except take care additional attributes within gtables. importantly needs take care sizing final gtable, different gtables going may different widths heights. default tries calculate maximum width/height among supplied gtables, options exists. , relative layering grobs gtable can modified left -.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/bind.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Row and column binding for gtables. — bind","text":"","code":"# S3 method for class 'gtable' rbind(..., size = \"max\", z = NULL) # S3 method for class 'gtable' cbind(..., size = \"max\", z = NULL)"},{"path":"https://gtable.r-lib.org/dev/reference/bind.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Row and column binding for gtables. — bind","text":"... gtables combine (x y) size widths (rbind) heights (cbind) combined across gtables: take values first, last gtable, compute min max values. Defaults max. z numeric vector indicating relative z values gtable. z values object resulting gtable modified fit order. NULL, z values obects within gtable modified.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/bind.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Row and column binding for gtables. — bind","text":"gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/bind.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Row and column binding for gtables. — bind","text":"","code":"library(grid) a <- rectGrob(gp = gpar(fill = \"red\")) b <- circleGrob() c <- linesGrob() row <- matrix(list(a, b), nrow = 1) col <- matrix(list(a, b), ncol = 1) mat <- matrix(list(a, b, c, nullGrob()), nrow = 2) row_gt <- gtable_matrix(\"demo\", row, unit(c(1, 1), \"null\"), unit(1, \"null\")) col_gt <- gtable_matrix(\"demo\", col, unit(1, \"null\"), unit(c(1, 1), \"null\")) mat_gt <- gtable_matrix(\"demo\", mat, unit(c(1, 1), \"null\"), unit(c(1, 1), \"null\")) # cbind c_binded <- cbind(mat_gt, col_gt, size = \"first\") plot(c_binded) # rbind r_binded <- rbind(mat_gt, row_gt, size = \"last\") plot(r_binded) # Dimensions must match along bind direction try(cbind(mat_gt, row_gt)) #> Error in cbind_gtable(x, y, size = size) : #> `x` and `y` must have the same number of rows"},{"path":"https://gtable.r-lib.org/dev/reference/gtable-package.html","id":null,"dir":"Reference","previous_headings":"","what":"gtable: Arrange 'Grobs' in Tables — gtable-package","title":"gtable: Arrange 'Grobs' in Tables — gtable-package","text":"Tools make easier work \"tables\" 'grobs'. 'gtable' package defines 'gtable' grob class specifies grid along list grobs placement grid. package makes easy manipulate combine 'gtable' objects complex compositions can built sequentially.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"gtable: Arrange 'Grobs' in Tables — gtable-package","text":"Maintainer: Thomas Lin Pedersen thomas.pedersen@posit.co Authors: Hadley Wickham hadley@posit.co contributors: Posit Software, PBC [copyright holder, funder]","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new grob table. — gtable","title":"Create a new grob table. — gtable","text":"grob table captures information needed layout grobs table structure. supports row column spanning, offers tools automatically figure correct dimensions, makes easy align combine multiple tables.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new grob table. — gtable","text":"","code":"gtable( widths = list(), heights = list(), respect = FALSE, name = \"layout\", rownames = NULL, colnames = NULL, vp = NULL )"},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new grob table. — gtable","text":"widths unit vector giving width column heights unit vector giving height row respect logical vector length 1: aspect ratio height width specified null units respected. See grid.layout() details name string giving name table. used name layout viewport rownames, colnames character vectors row column names, used characteric subsetting, particularly gtable_align, gtable_join. vp grid viewport object (NULL).","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new grob table. — gtable","text":"gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a new grob table. — gtable","text":"grob put viewport - grobs location combined one cell. grob takes entire cell viewport justification control available. constructs viewports gTree needed display table.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"components","dir":"Reference","previous_headings":"","what":"Components","title":"Create a new grob table. — gtable","text":"three basics components grob table: specification table (cell heights widths), layout (grob, position, name settings), global parameters. easier understand gtable works head keep table separate contents. cell can 0, 1, many grobs inside. grob must belong least one cell, can span across many cells.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"layout","dir":"Reference","previous_headings":"","what":"Layout","title":"Create a new grob table. — gtable","text":"layout details stored data frame one row grob, columns: t top extent grob r right extent grob b bottom extent l left extent grob z z-order grob - used reorder grobs rendered clip string, specifying grob clipped: either \"\", \"\" \"inherit\" name, character vector used name grob viewport need modify data frame directly - instead use functions like gtable_add_grob.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a new grob table. — gtable","text":"","code":"library(grid) a <- gtable(unit(1:3, c(\"cm\")), unit(5, \"cm\")) a #> TableGrob (1 x 3) \"layout\": 0 grobs gtable_show_layout(a) # Add a grob: rect <- rectGrob(gp = gpar(fill = \"black\")) a <- gtable_add_grob(a, rect, 1, 1) a #> TableGrob (1 x 3) \"layout\": 1 grobs #> z cells name grob #> 1 1 (1-1,1-1) layout rect[GRID.rect.21] plot(a) # gtables behave like matrices: dim(a) #> [1] 1 3 t(a) #> TableGrob (3 x 1) \"layout\": 1 grobs #> z cells name grob #> 1 1 (1-1,1-1) layout rect[GRID.rect.21] plot(t(a)) # when subsetting, grobs are retained if their extents lie in the # rows/columns that retained. b <- gtable(unit(c(2, 2, 2), \"cm\"), unit(c(2, 2, 2), \"cm\")) b <- gtable_add_grob(b, rect, 2, 2) b[1, ] #> TableGrob (1 x 3) \"layout\": 0 grobs b[, 1] #> TableGrob (3 x 1) \"layout\": 0 grobs b[2, 2] #> TableGrob (1 x 1) \"layout\": 1 grobs #> z cells name grob #> 1 1 (1-1,1-1) layout rect[GRID.rect.21] # gtable have row and column names rownames(b) <- 1:3 rownames(b)[2] <- 200 colnames(b) <- letters[1:3] dimnames(b) #> [[1]] #> [1] 1 200 3 #> #> [[2]] #> [1] \"a\" \"b\" \"c\" #>"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_cols.html","id":null,"dir":"Reference","previous_headings":"","what":"Add new columns in specified position. — gtable_add_cols","title":"Add new columns in specified position. — gtable_add_cols","text":"Insert new columns gtable adjust grob placement accordingly. columns added middle grob spanning multiple columns, grob continue span . column added left right grob, grob span new column(s).","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_cols.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add new columns in specified position. — gtable_add_cols","text":"","code":"gtable_add_cols(x, widths, pos = -1)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_cols.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add new columns in specified position. — gtable_add_cols","text":"x gtable() object widths unit vector giving widths new columns pos new columns added right position. Defaults adding col right. 0 adds left.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_cols.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add new columns in specified position. — gtable_add_cols","text":"gtable new columns added.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_cols.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add new columns in specified position. — gtable_add_cols","text":"","code":"library(grid) rect <- rectGrob(gp = gpar(fill = \"#00000080\")) tab <- gtable(unit(rep(1, 3), \"null\"), unit(rep(1, 3), \"null\")) tab <- gtable_add_grob(tab, rect, t = 1, l = 1, r = 3) tab <- gtable_add_grob(tab, rect, t = 1, b = 3, l = 1) tab <- gtable_add_grob(tab, rect, t = 1, b = 3, l = 3) dim(tab) #> [1] 3 3 plot(tab) # Grobs will continue to span over new rows if added in the middle tab2 <- gtable_add_cols(tab, unit(1, \"null\"), 1) dim(tab2) #> [1] 3 4 plot(tab2) # But not when added to left (0) or right (-1, the default) tab3 <- gtable_add_cols(tab, unit(1, \"null\")) tab3 <- gtable_add_cols(tab3, unit(1, \"null\"), 0) dim(tab3) #> [1] 3 5 plot(tab3)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_grob.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","title":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","text":"adds grobs table - affect table layout way. gtable model, grobs always fill complete table cell. want custom justification might need define grob dimension absolute units, put another gtable can added gtable instead grob.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_grob.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","text":"","code":"gtable_add_grob( x, grobs, t, l, b = t, r = l, z = Inf, clip = \"on\", name = x$name )"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_grob.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","text":"x gtable() object grobs single grob list grobs t numeric vector giving top extent grobs l numeric vector giving left extent grobs b numeric vector giving bottom extent grobs r numeric vector giving right extent grobs z numeric vector giving order grobs plotted. Use Inf (default) plot -Inf existing grobs. default positions integers, giving plenty room insert new grobs existing grobs. clip drawing clipped specified cells (\"\"), entire table (\"inherit\"), (\"\") name name grob - used modify grob name plotted.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_grob.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","text":"gtable object new grob(s) added","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_grob.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","text":"","code":"library(grid) gt <- gtable(widths = unit(c(1, 1), 'null'), heights = unit(c(1, 1), 'null')) pts <- pointsGrob(x = runif(5), y = runif(5)) # Add a grob to a single cell (top-right cell) gt <- gtable_add_grob(gt, pts, t = 1, l = 2) # Add a grob spanning multiple cells gt <- gtable_add_grob(gt, pts, t = 1, l = 1, b = 2) plot(gt)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_padding.html","id":null,"dir":"Reference","previous_headings":"","what":"Add padding around edges of table. — gtable_add_padding","title":"Add padding around edges of table. — gtable_add_padding","text":"convenience function adding extra row extra column edge table.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_padding.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add padding around edges of table. — gtable_add_padding","text":"","code":"gtable_add_padding(x, padding)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_padding.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add padding around edges of table. — gtable_add_padding","text":"x gtable() object padding vector length 4: top, right, bottom, left. Normal recycling rules apply.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_padding.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add padding around edges of table. — gtable_add_padding","text":"gtable object","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_padding.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add padding around edges of table. — gtable_add_padding","text":"","code":"library(grid) gt <- gtable(unit(1, \"null\"), unit(1, \"null\")) gt <- gtable_add_grob(gt, rectGrob(gp = gpar(fill = \"black\")), 1, 1) plot(gt) plot(cbind(gt, gt)) plot(rbind(gt, gt)) pad <- gtable_add_padding(gt, unit(1, \"cm\")) plot(pad) plot(cbind(pad, pad)) plot(rbind(pad, pad))"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_rows.html","id":null,"dir":"Reference","previous_headings":"","what":"Add new rows in specified position. — gtable_add_rows","title":"Add new rows in specified position. — gtable_add_rows","text":"Insert new rows gtable adjust grob placement accordingly. rows added middle grob spanning multiple rows, grob continue span . row added grob, grob span new row(s).","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_rows.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add new rows in specified position. — gtable_add_rows","text":"","code":"gtable_add_rows(x, heights, pos = -1)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_rows.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add new rows in specified position. — gtable_add_rows","text":"x gtable() object heights unit vector giving heights new rows pos new row added position. Defaults adding row bottom. 0 adds top.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_rows.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add new rows in specified position. — gtable_add_rows","text":"gtable new rows added.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_rows.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add new rows in specified position. — gtable_add_rows","text":"","code":"library(grid) rect <- rectGrob(gp = gpar(fill = \"#00000080\")) tab <- gtable(unit(rep(1, 3), \"null\"), unit(rep(1, 3), \"null\")) tab <- gtable_add_grob(tab, rect, t = 1, l = 1, r = 3) tab <- gtable_add_grob(tab, rect, t = 1, b = 3, l = 1) tab <- gtable_add_grob(tab, rect, t = 1, b = 3, l = 3) dim(tab) #> [1] 3 3 plot(tab) # Grobs will continue to span over new rows if added in the middle tab2 <- gtable_add_rows(tab, unit(1, \"null\"), 1) dim(tab2) #> [1] 4 3 plot(tab2) # But not when added to top (0) or bottom (-1, the default) tab3 <- gtable_add_rows(tab, unit(1, \"null\")) tab3 <- gtable_add_rows(tab3, unit(1, \"null\"), 0) dim(tab3) #> [1] 5 3 plot(tab3)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_space.html","id":null,"dir":"Reference","previous_headings":"","what":"Add row/column spacing. — gtable_add_space","title":"Add row/column spacing. — gtable_add_space","text":"Adds width space columns height space rows, effictvely pushing existing cells apart.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_space.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add row/column spacing. — gtable_add_space","text":"","code":"gtable_add_col_space(x, width) gtable_add_row_space(x, height)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_space.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add row/column spacing. — gtable_add_space","text":"x gtable object width vector units length 1 ncol - 1 height vector units length 1 nrow - 1","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_space.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add row/column spacing. — gtable_add_space","text":"gtable additional rows columns added","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_space.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add row/column spacing. — gtable_add_space","text":"","code":"library(grid) rect <- rectGrob() rect_mat <- matrix(rep(list(rect), 9), nrow = 3) gt <- gtable_matrix(\"rects\", rect_mat, widths = unit(rep(1, 3), \"null\"), heights = unit(rep(1, 3), \"null\")) plot(gt) # Add spacing between the grobs # same height between all rows gt <- gtable_add_row_space(gt, unit(0.5, \"cm\")) # Different width between the columns gt <- gtable_add_col_space(gt, unit(c(0.5, 1), \"cm\")) plot(gt)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a single column gtable — gtable_col","title":"Create a single column gtable — gtable_col","text":"function stacks list grobs single column gtable given width heights.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a single column gtable — gtable_col","text":"","code":"gtable_col( name, grobs, width = NULL, heights = NULL, z = NULL, vp = NULL, clip = \"inherit\" )"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a single column gtable — gtable_col","text":"name string giving name table. used name layout viewport grobs single grob list grobs width unit vector giving width column heights unit vector giving height row z numeric vector giving order grobs plotted. Use Inf (default) plot -Inf existing grobs. default positions integers, giving plenty room insert new grobs existing grobs. vp grid viewport object (NULL). clip drawing clipped specified cells (\"\"), entire table (\"inherit\"), (\"\")","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_col.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a single column gtable — gtable_col","text":"gtable one column many rows elements grobs list.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_col.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a single column gtable — gtable_col","text":"","code":"library(grid) a <- rectGrob(gp = gpar(fill = \"red\")) b <- circleGrob() c <- linesGrob() gt <- gtable_col(\"demo\", list(a, b, c)) gt #> TableGrob (3 x 1) \"demo\": 3 grobs #> z cells name grob #> 1 1 (1-1,1-1) demo rect[GRID.rect.27] #> 2 2 (2-2,1-1) demo circle[GRID.circle.28] #> 3 3 (3-3,1-1) demo lines[GRID.lines.29] plot(gt) gtable_show_layout(gt)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_filter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter cells by name — gtable_filter","title":"Filter cells by name — gtable_filter","text":"Normally gtable considered matrix indexing indexing working cell layout grobs contains. gtable_filter allows subset grobs name optionally remove rows columns left empty subsetting","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_filter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter cells by name — gtable_filter","text":"","code":"gtable_filter(x, pattern, fixed = FALSE, trim = TRUE, invert = FALSE)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_filter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter cells by name — gtable_filter","text":"x gtable object pattern character string containing regular expression (character string fixed = TRUE) matched given character vector. Coerced .character character string possible. character vector length 2 supplied, first element used warning. Missing values allowed except regexpr, gregexpr regexec. fixed logical. TRUE, pattern string matched . Overrides conflicting arguments. trim TRUE, gtable_trim() used trim empty cells. invert filtering inverted cells matching pattern removed instead kept.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_filter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter cells by name — gtable_filter","text":"gtable containing matching grobs, potentially stripped empty columns rows","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_filter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filter cells by name — gtable_filter","text":"","code":"library(grid) gt <- gtable(unit(rep(5, 3), c(\"cm\")), unit(5, \"cm\")) rect <- rectGrob(gp = gpar(fill = \"black\")) circ <- circleGrob(gp = gpar(fill = \"red\")) gt <- gtable_add_grob(gt, rect, 1, 1, name = \"rect\") gt <- gtable_add_grob(gt, circ, 1, 3, name = \"circ\") plot(gtable_filter(gt, \"rect\")) plot(gtable_filter(gt, \"rect\", trim = FALSE)) plot(gtable_filter(gt, \"circ\")) plot(gtable_filter(gt, \"circ\", trim = FALSE))"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_height.html","id":null,"dir":"Reference","previous_headings":"","what":"Returns the height of a gtable, in the gtable's units — gtable_height","title":"Returns the height of a gtable, in the gtable's units — gtable_height","text":"Note unlike heightDetails.gtable, can return relative units.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_height.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Returns the height of a gtable, in the gtable's units — gtable_height","text":"","code":"gtable_height(x)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_height.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Returns the height of a gtable, in the gtable's units — gtable_height","text":"x gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a gtable from a matrix of grobs. — gtable_matrix","title":"Create a gtable from a matrix of grobs. — gtable_matrix","text":"function takes matrix grobs create gtable matching grobs position matrix, given heights widths.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a gtable from a matrix of grobs. — gtable_matrix","text":"","code":"gtable_matrix( name, grobs, widths = NULL, heights = NULL, z = NULL, respect = FALSE, clip = \"on\", vp = NULL )"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a gtable from a matrix of grobs. — gtable_matrix","text":"name string giving name table. used name layout viewport grobs single grob list grobs widths unit vector giving width column heights unit vector giving height row z numeric matrix dimensions grobs, specifying order grobs drawn. respect logical vector length 1: aspect ratio height width specified null units respected. See grid.layout() details clip drawing clipped specified cells (\"\"), entire table (\"inherit\"), (\"\") vp grid viewport object (NULL).","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a gtable from a matrix of grobs. — gtable_matrix","text":"gtable dimensions grobs matrix.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a gtable from a matrix of grobs. — gtable_matrix","text":"","code":"library(grid) a <- rectGrob(gp = gpar(fill = \"red\")) b <- circleGrob() c <- linesGrob() row <- matrix(list(a, b, c), nrow = 1) col <- matrix(list(a, b, c), ncol = 1) mat <- matrix(list(a, b, c, nullGrob()), nrow = 2) gtable_matrix(\"demo\", row, unit(c(1, 1, 1), \"null\"), unit(1, \"null\")) #> TableGrob (1 x 3) \"demo\": 3 grobs #> z cells name grob #> 1 1 (1-1,1-1) demo rect[GRID.rect.48] #> 2 2 (1-1,2-2) demo circle[GRID.circle.49] #> 3 3 (1-1,3-3) demo lines[GRID.lines.50] gtable_matrix(\"demo\", col, unit(1, \"null\"), unit(c(1, 1, 1), \"null\")) #> TableGrob (3 x 1) \"demo\": 3 grobs #> z cells name grob #> 1 1 (1-1,1-1) demo rect[GRID.rect.48] #> 2 2 (2-2,1-1) demo circle[GRID.circle.49] #> 3 3 (3-3,1-1) demo lines[GRID.lines.50] gtable_matrix(\"demo\", mat, unit(c(1, 1), \"null\"), unit(c(1, 1), \"null\")) #> TableGrob (2 x 2) \"demo\": 4 grobs #> z cells name grob #> 1 1 (1-1,1-1) demo rect[GRID.rect.48] #> 2 2 (2-2,1-1) demo circle[GRID.circle.49] #> 3 3 (1-1,2-2) demo lines[GRID.lines.50] #> 4 4 (2-2,2-2) demo null[GRID.null.51] # Can specify z ordering z <- matrix(c(3, 1, 2, 4), nrow = 2) gtable_matrix(\"demo\", mat, unit(c(1, 1), \"null\"), unit(c(1, 1), \"null\"), z = z) #> TableGrob (2 x 2) \"demo\": 4 grobs #> z cells name grob #> 1 3 (1-1,1-1) demo rect[GRID.rect.48] #> 2 1 (2-2,1-1) demo circle[GRID.circle.49] #> 3 2 (1-1,2-2) demo lines[GRID.lines.50] #> 4 4 (2-2,2-2) demo null[GRID.null.51]"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a single row gtable. — gtable_row","title":"Create a single row gtable. — gtable_row","text":"function puts grobs list side--side single-row gtable left right witrh given widths height.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a single row gtable. — gtable_row","text":"","code":"gtable_row( name, grobs, height = NULL, widths = NULL, z = NULL, vp = NULL, clip = \"inherit\" )"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a single row gtable. — gtable_row","text":"name string giving name table. used name layout viewport grobs single grob list grobs height unit vector giving height row widths unit vector giving width column z numeric vector giving order grobs plotted. Use Inf (default) plot -Inf existing grobs. default positions integers, giving plenty room insert new grobs existing grobs. vp grid viewport object (NULL). clip drawing clipped specified cells (\"\"), entire table (\"inherit\"), (\"\")","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_row.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a single row gtable. — gtable_row","text":"gtable single row number columns elements grobs list","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_row.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a single row gtable. — gtable_row","text":"","code":"library(grid) a <- rectGrob(gp = gpar(fill = \"red\")) b <- circleGrob() c <- linesGrob() gt <- gtable_row(\"demo\", list(a, b, c)) gt #> TableGrob (1 x 3) \"demo\": 3 grobs #> z cells name grob #> 1 1 (1-1,1-1) demo rect[GRID.rect.52] #> 2 2 (1-1,2-2) demo circle[GRID.circle.53] #> 3 3 (1-1,3-3) demo lines[GRID.lines.54] plot(gt) gtable_show_layout(gt)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_show_layout.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualise the layout of a gtable. — gtable_show_layout","title":"Visualise the layout of a gtable. — gtable_show_layout","text":"function simple wrapper around grid::grid.show.layout() allows inspect layout gtable.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_show_layout.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualise the layout of a gtable. — gtable_show_layout","text":"","code":"gtable_show_layout(x, ...)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_show_layout.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualise the layout of a gtable. — gtable_show_layout","text":"x gtable object ... Arguments passed grid::grid.show.layout l Grid layout object. newpage logical value indicating whether move new page drawing diagram. vp.ex positive number, typically \\((0,1]\\), specifying scaling layout. bg colour used background. cell.border colour used draw borders cells layout. cell.fill colour used fill cells layout. cell.label logical indicating whether layout cells labelled. label.col colour used layout cell labels. unit.col colour used labelling widths/heights columns/rows. vp Grid viewport object (NULL).","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_show_layout.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualise the layout of a gtable. — gtable_show_layout","text":"","code":"gt <- gtable(widths = grid::unit(c(1, 0.5, 2), c(\"null\", \"cm\", \"null\")), heights = grid::unit(c(0.2, 1, 3), c(\"inch\", \"null\", \"cm\"))) gtable_show_layout(gt)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_spacer.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a row/col spacer gtable. — gtable_spacer","title":"Create a row/col spacer gtable. — gtable_spacer","text":"Create zero-column zero-row gtable given heights widths respectively.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_spacer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a row/col spacer gtable. — gtable_spacer","text":"","code":"gtable_row_spacer(widths) gtable_col_spacer(heights)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_spacer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a row/col spacer gtable. — gtable_spacer","text":"widths unit vector widths heights unit vector heights","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_spacer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a row/col spacer gtable. — gtable_spacer","text":"gtable object","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_trim.html","id":null,"dir":"Reference","previous_headings":"","what":"Trim off empty cells. — gtable_trim","title":"Trim off empty cells. — gtable_trim","text":"function detects rows columns contain grobs removes thewm gtable. rows /columns removed non-zero height/width relative layout gtable may change.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_trim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trim off empty cells. — gtable_trim","text":"","code":"gtable_trim(x)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_trim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trim off empty cells. — gtable_trim","text":"x gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_trim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trim off empty cells. — gtable_trim","text":"gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_trim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trim off empty cells. — gtable_trim","text":"","code":"library(grid) rect <- rectGrob(gp = gpar(fill = \"black\")) base <- gtable(unit(c(2, 2, 2), \"cm\"), unit(c(2, 2, 2), \"cm\")) center <- gtable_add_grob(base, rect, 2, 2) plot(center) plot(gtable_trim(center)) col <- gtable_add_grob(base, rect, 1, 2, 3, 2) plot(col) plot(gtable_trim(col)) row <- gtable_add_grob(base, rect, 2, 1, 2, 3) plot(row) plot(gtable_trim(row))"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Returns the width of a gtable, in the gtable's units — gtable_width","title":"Returns the width of a gtable, in the gtable's units — gtable_width","text":"Note unlike widthDetails.gtable, can return relative units.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Returns the width of a gtable, in the gtable's units — gtable_width","text":"","code":"gtable_width(x)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_width.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Returns the width of a gtable, in the gtable's units — gtable_width","text":"x gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/is.gtable.html","id":null,"dir":"Reference","previous_headings":"","what":"Is this a gtable? — is.gtable","title":"Is this a gtable? — is.gtable","text":"gtable?","code":""},{"path":"https://gtable.r-lib.org/dev/reference/is.gtable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is this a gtable? — is.gtable","text":"","code":"is.gtable(x)"},{"path":"https://gtable.r-lib.org/dev/reference/is.gtable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is this a gtable? — is.gtable","text":"x object test","code":""},{"path":"https://gtable.r-lib.org/dev/reference/print.gtable.html","id":null,"dir":"Reference","previous_headings":"","what":"Print a gtable object — print.gtable","title":"Print a gtable object — print.gtable","text":"Print gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/print.gtable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print a gtable object — print.gtable","text":"","code":"# S3 method for class 'gtable' print(x, zsort = FALSE, ...)"},{"path":"https://gtable.r-lib.org/dev/reference/print.gtable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print a gtable object — print.gtable","text":"x gtable object. zsort Sort z values? Default FALSE. ... arguments (used method).","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-development-version","dir":"Changelog","previous_headings":"","what":"gtable (development version)","title":"gtable (development version)","text":"Added .gtable() S3 method (#97). Add clip argument gtable_col() gtable_row() (#56)","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-035","dir":"Changelog","previous_headings":"","what":"gtable 0.3.5","title":"gtable 0.3.5","text":"CRAN release: 2024-04-22 Fixed partial matching issue constructing viewport gtable() (#94) General upkeep","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-034","dir":"Changelog","previous_headings":"","what":"gtable 0.3.4","title":"gtable 0.3.4","text":"CRAN release: 2023-08-21 Fix package doc links","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-033","dir":"Changelog","previous_headings":"","what":"gtable 0.3.3","title":"gtable 0.3.3","text":"CRAN release: 2023-03-21 Specify minimum rlang version","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-032","dir":"Changelog","previous_headings":"","what":"gtable 0.3.2","title":"gtable 0.3.2","text":"CRAN release: 2023-03-17 General upkeep","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-031","dir":"Changelog","previous_headings":"","what":"gtable 0.3.1","title":"gtable 0.3.1","text":"CRAN release: 2022-09-01 Re-documented fix HTML issues .Rd. gtable re-licensed MIT (#85).","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-030","dir":"Changelog","previous_headings":"","what":"gtable 0.3.0","title":"gtable 0.3.0","text":"CRAN release: 2019-03-25 Made range internal changes increase performance gtable construction, include: Use performant data.frame constructor . Treat layout data.frame list indexing modifying . Use length widths heights fields instead ncol() nrow() internally. Substitute stopifnot(...) (!...) stop(). Better documentation, including new README, vignette performance profiling pkgdown site. New logo now error index gtable non-increasing indices. Dimnames now inherited grobs data gtable_col(), gtable_row(), gtable_matrix() gtable_trim now works empty gtables gtable_filter now invert argument remove grops matching name.","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-020","dir":"Changelog","previous_headings":"","what":"gtable 0.2.0","title":"gtable 0.2.0","text":"CRAN release: 2016-02-26 Switch preDrawDetails() postDrawDetails() methods makeContent() makeContext() methods (@pmur002, #50). better approach facilitiated changes grid. Learn https://journal.r-project.org/archive/2013-2/murrell.pdf. Added NEWS.md file track changes package. Partial argument matches fixed. Import grid instead depending .","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-012","dir":"Changelog","previous_headings":"","what":"gtable 0.1.2","title":"gtable 0.1.2","text":"CRAN release: 2012-12-05 print.gtable now prints z order grobs, longer sort names z order. Previously, layout names sorted z order, grobs weren’t. resulted mismatch names grobs. ’s better sort z default, since doesn’t match indexing works. zsort option allows output sorted z.","code":""}]
+[{"path":[]},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@posit.co. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://gtable.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://gtable.r-lib.org/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 gtable authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://gtable.r-lib.org/dev/articles/profiling.html","id":"performance-focused-changes-across-versions","dir":"Articles","previous_headings":"","what":"Performance focused changes across versions","title":"Profiling Performance","text":"keep track changes focused improving performance gtable summarised :","code":""},{"path":"https://gtable.r-lib.org/dev/articles/profiling.html","id":"v0-3-5-9000","dir":"Articles","previous_headings":"Performance focused changes across versions","what":"v0.3.5.9000","title":"Profiling Performance","text":"Profiling results gtable v0.2.0 identified range areas easily improved fairly small code changes. changes resulted roughly 20% decrease running time profiling code general, gtable related functions 50 80% decrease running time specifically. data.frame construction indexing. gtable now includes minimal constructor makes input checking used working layout data frame. , indexing layout data frame improved either treating list internally directly calling .subset2 Input validation. stopifnot() identified bottleneck removed favor standard (...) stop() Dimension querying. use nrow() ncol() internally substituted direct calls length() heights widths unit vectors","code":""},{"path":"https://gtable.r-lib.org/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Hadley Wickham. Author. Thomas Lin Pedersen. Author, maintainer. . Copyright holder, funder.","code":""},{"path":"https://gtable.r-lib.org/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Wickham H, Pedersen T (2024). gtable: Arrange 'Grobs' Tables. R package version 0.3.5.9000, https://github.com/r-lib/gtable, https://gtable.r-lib.org.","code":"@Manual{, title = {gtable: Arrange 'Grobs' in Tables}, author = {Hadley Wickham and Thomas Lin Pedersen}, year = {2024}, note = {R package version 0.3.5.9000, https://github.com/r-lib/gtable}, url = {https://gtable.r-lib.org}, }"},{"path":"https://gtable.r-lib.org/dev/index.html","id":"gtable-","dir":"","previous_headings":"","what":"Arrange Grobs in Tables","title":"Arrange Grobs in Tables","text":"gtable layout engine built top grid package. used abstract away creation (potentially nested) grids viewports graphic objects can placed. gtable makes easy ensure alignment graphic elements piecemeal compositions complex graphics. gtable layout engine powering ggplot2 thus used extensively many plotting functions R without called directly.","code":""},{"path":"https://gtable.r-lib.org/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Arrange Grobs in Tables","text":"can install released version gtable CRAN : use remotes package install development version GitHub","code":"install.packages(\"gtable\") # install.packages(\"pak\") pak::pak(\"r-lib/gtable\")"},{"path":"https://gtable.r-lib.org/dev/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Arrange Grobs in Tables","text":"ggplot2 uses gtable laying plots, possible access gtable representation plot inspection modification: gtable object collection graphic elements along placement grid dimensions grid . Graphic elements can span multiple rows columns grid gtables allowing complex automatically arranging layouts. gtable object grob, can thus drawn using standard functions grid package: people interact gtable ggplot2, possible build plot ground .","code":"library(gtable) library(ggplot2) p <- ggplot(mtcars, aes(mpg, disp)) + geom_point() p_table <- ggplotGrob(p) p_table #> TableGrob (16 x 13) \"layout\": 22 grobs #> z cells name grob #> 1 0 ( 1-16, 1-13) background rect[plot.background..rect.38] #> 2 5 ( 8- 8, 6- 6) spacer zeroGrob[NULL] #> 3 7 ( 9- 9, 6- 6) axis-l absoluteGrob[GRID.absoluteGrob.26] #> 4 3 (10-10, 6- 6) spacer zeroGrob[NULL] #> 5 6 ( 8- 8, 7- 7) axis-t zeroGrob[NULL] #> 6 1 ( 9- 9, 7- 7) panel gTree[panel-1.gTree.17] #> 7 9 (10-10, 7- 7) axis-b absoluteGrob[GRID.absoluteGrob.22] #> 8 4 ( 8- 8, 8- 8) spacer zeroGrob[NULL] #> 9 8 ( 9- 9, 8- 8) axis-r zeroGrob[NULL] #> 10 2 (10-10, 8- 8) spacer zeroGrob[NULL] #> 11 10 ( 7- 7, 7- 7) xlab-t zeroGrob[NULL] #> 12 11 (11-11, 7- 7) xlab-b titleGrob[axis.title.x.bottom..titleGrob.30] #> 13 12 ( 9- 9, 5- 5) ylab-l titleGrob[axis.title.y.left..titleGrob.33] #> 14 13 ( 9- 9, 9- 9) ylab-r zeroGrob[NULL] #> 15 14 ( 9- 9,11-11) guide-box-right zeroGrob[NULL] #> 16 15 ( 9- 9, 3- 3) guide-box-left zeroGrob[NULL] #> 17 16 (13-13, 7- 7) guide-box-bottom zeroGrob[NULL] #> 18 17 ( 5- 5, 7- 7) guide-box-top zeroGrob[NULL] #> 19 18 ( 9- 9, 7- 7) guide-box-inside zeroGrob[NULL] #> 20 19 ( 4- 4, 7- 7) subtitle zeroGrob[plot.subtitle..zeroGrob.35] #> 21 20 ( 3- 3, 7- 7) title zeroGrob[plot.title..zeroGrob.34] #> 22 21 (14-14, 7- 7) caption zeroGrob[plot.caption..zeroGrob.36] library(grid) grid.draw(p_table) # alternative use plot(p_table) # 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)"},{"path":"https://gtable.r-lib.org/dev/reference/as.gtable.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a gtable — as.gtable","title":"Convert to a gtable — as.gtable","text":"Convert gtable","code":""},{"path":"https://gtable.r-lib.org/dev/reference/as.gtable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a gtable — as.gtable","text":"","code":"as.gtable(x, ...) # S3 method for class 'grob' as.gtable(x, widths = NULL, heights = NULL, ...)"},{"path":"https://gtable.r-lib.org/dev/reference/as.gtable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a gtable — as.gtable","text":"x object convert. ... Arguments forwarded methods. widths, heights Scalar unit setting size table. Defaults grid::grobWidth() grid::grobHeight() x respectively.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/as.gtable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to a gtable — as.gtable","text":"gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/as.gtable.html","id":"methods-by-class-","dir":"Reference","previous_headings":"","what":"Methods (by class)","title":"Convert to a gtable — as.gtable","text":".gtable(grob): Creates 1-cell gtable containing grob.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/bind.html","id":null,"dir":"Reference","previous_headings":"","what":"Row and column binding for gtables. — bind","title":"Row and column binding for gtables. — bind","text":"functions parallels matrix/data.frame row column bindings. work way, except take care additional attributes within gtables. importantly needs take care sizing final gtable, different gtables going may different widths heights. default tries calculate maximum width/height among supplied gtables, options exists. , relative layering grobs gtable can modified left -.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/bind.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Row and column binding for gtables. — bind","text":"","code":"# S3 method for class 'gtable' rbind(..., size = \"max\", z = NULL) # S3 method for class 'gtable' cbind(..., size = \"max\", z = NULL)"},{"path":"https://gtable.r-lib.org/dev/reference/bind.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Row and column binding for gtables. — bind","text":"... gtables combine (x y) size widths (rbind) heights (cbind) combined across gtables: take values first, last gtable, compute min max values. Defaults max. z numeric vector indicating relative z values gtable. z values object resulting gtable modified fit order. NULL, z values obects within gtable modified.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/bind.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Row and column binding for gtables. — bind","text":"gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/bind.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Row and column binding for gtables. — bind","text":"","code":"library(grid) a <- rectGrob(gp = gpar(fill = \"red\")) b <- circleGrob() c <- linesGrob() row <- matrix(list(a, b), nrow = 1) col <- matrix(list(a, b), ncol = 1) mat <- matrix(list(a, b, c, nullGrob()), nrow = 2) row_gt <- gtable_matrix(\"demo\", row, unit(c(1, 1), \"null\"), unit(1, \"null\")) col_gt <- gtable_matrix(\"demo\", col, unit(1, \"null\"), unit(c(1, 1), \"null\")) mat_gt <- gtable_matrix(\"demo\", mat, unit(c(1, 1), \"null\"), unit(c(1, 1), \"null\")) # cbind c_binded <- cbind(mat_gt, col_gt, size = \"first\") plot(c_binded) # rbind r_binded <- rbind(mat_gt, row_gt, size = \"last\") plot(r_binded) # Dimensions must match along bind direction try(cbind(mat_gt, row_gt)) #> Error in cbind_gtable(x, y, size = size) : #> `x` and `y` must have the same number of rows"},{"path":"https://gtable.r-lib.org/dev/reference/gtable-package.html","id":null,"dir":"Reference","previous_headings":"","what":"gtable: Arrange 'Grobs' in Tables — gtable-package","title":"gtable: Arrange 'Grobs' in Tables — gtable-package","text":"Tools make easier work \"tables\" 'grobs'. 'gtable' package defines 'gtable' grob class specifies grid along list grobs placement grid. package makes easy manipulate combine 'gtable' objects complex compositions can built sequentially.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"gtable: Arrange 'Grobs' in Tables — gtable-package","text":"Maintainer: Thomas Lin Pedersen thomas.pedersen@posit.co Authors: Hadley Wickham hadley@posit.co contributors: Posit Software, PBC [copyright holder, funder]","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new grob table. — gtable","title":"Create a new grob table. — gtable","text":"grob table captures information needed layout grobs table structure. supports row column spanning, offers tools automatically figure correct dimensions, makes easy align combine multiple tables.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new grob table. — gtable","text":"","code":"gtable( widths = list(), heights = list(), respect = FALSE, name = \"layout\", rownames = NULL, colnames = NULL, vp = NULL )"},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new grob table. — gtable","text":"widths unit vector giving width column heights unit vector giving height row respect logical vector length 1: aspect ratio height width specified null units respected. See grid.layout() details name string giving name table. used name layout viewport rownames, colnames character vectors row column names, used characteric subsetting. vp grid viewport object (NULL).","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new grob table. — gtable","text":"gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a new grob table. — gtable","text":"grob put viewport - grobs location combined one cell. grob takes entire cell viewport justification control available. constructs viewports gTree needed display table.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"components","dir":"Reference","previous_headings":"","what":"Components","title":"Create a new grob table. — gtable","text":"three basics components grob table: specification table (cell heights widths), layout (grob, position, name settings), global parameters. easier understand gtable works head keep table separate contents. cell can 0, 1, many grobs inside. grob must belong least one cell, can span across many cells.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"layout","dir":"Reference","previous_headings":"","what":"Layout","title":"Create a new grob table. — gtable","text":"layout details stored data frame one row grob, columns: t top extent grob r right extent grob b bottom extent l left extent grob z z-order grob - used reorder grobs rendered clip string, specifying grob clipped: either \"\", \"\" \"inherit\" name, character vector used name grob viewport need modify data frame directly - instead use functions like gtable_add_grob.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a new grob table. — gtable","text":"","code":"library(grid) a <- gtable(unit(1:3, c(\"cm\")), unit(5, \"cm\")) a #> TableGrob (1 x 3) \"layout\": 0 grobs gtable_show_layout(a) # Add a grob: rect <- rectGrob(gp = gpar(fill = \"black\")) a <- gtable_add_grob(a, rect, 1, 1) a #> TableGrob (1 x 3) \"layout\": 1 grobs #> z cells name grob #> 1 1 (1-1,1-1) layout rect[GRID.rect.21] plot(a) # gtables behave like matrices: dim(a) #> [1] 1 3 t(a) #> TableGrob (3 x 1) \"layout\": 1 grobs #> z cells name grob #> 1 1 (1-1,1-1) layout rect[GRID.rect.21] plot(t(a)) # when subsetting, grobs are retained if their extents lie in the # rows/columns that retained. b <- gtable(unit(c(2, 2, 2), \"cm\"), unit(c(2, 2, 2), \"cm\")) b <- gtable_add_grob(b, rect, 2, 2) b[1, ] #> TableGrob (1 x 3) \"layout\": 0 grobs b[, 1] #> TableGrob (3 x 1) \"layout\": 0 grobs b[2, 2] #> TableGrob (1 x 1) \"layout\": 1 grobs #> z cells name grob #> 1 1 (1-1,1-1) layout rect[GRID.rect.21] # gtable have row and column names rownames(b) <- 1:3 rownames(b)[2] <- 200 colnames(b) <- letters[1:3] dimnames(b) #> [[1]] #> [1] 1 200 3 #> #> [[2]] #> [1] \"a\" \"b\" \"c\" #>"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_cols.html","id":null,"dir":"Reference","previous_headings":"","what":"Add new columns in specified position. — gtable_add_cols","title":"Add new columns in specified position. — gtable_add_cols","text":"Insert new columns gtable adjust grob placement accordingly. columns added middle grob spanning multiple columns, grob continue span . column added left right grob, grob span new column(s).","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_cols.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add new columns in specified position. — gtable_add_cols","text":"","code":"gtable_add_cols(x, widths, pos = -1)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_cols.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add new columns in specified position. — gtable_add_cols","text":"x gtable() object widths unit vector giving widths new columns pos new columns added right position. Defaults adding col right. 0 adds left.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_cols.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add new columns in specified position. — gtable_add_cols","text":"gtable new columns added.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_cols.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add new columns in specified position. — gtable_add_cols","text":"","code":"library(grid) rect <- rectGrob(gp = gpar(fill = \"#00000080\")) tab <- gtable(unit(rep(1, 3), \"null\"), unit(rep(1, 3), \"null\")) tab <- gtable_add_grob(tab, rect, t = 1, l = 1, r = 3) tab <- gtable_add_grob(tab, rect, t = 1, b = 3, l = 1) tab <- gtable_add_grob(tab, rect, t = 1, b = 3, l = 3) dim(tab) #> [1] 3 3 plot(tab) # Grobs will continue to span over new rows if added in the middle tab2 <- gtable_add_cols(tab, unit(1, \"null\"), 1) dim(tab2) #> [1] 3 4 plot(tab2) # But not when added to left (0) or right (-1, the default) tab3 <- gtable_add_cols(tab, unit(1, \"null\")) tab3 <- gtable_add_cols(tab3, unit(1, \"null\"), 0) dim(tab3) #> [1] 3 5 plot(tab3)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_grob.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","title":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","text":"adds grobs table - affect table layout way. gtable model, grobs always fill complete table cell. want custom justification might need define grob dimension absolute units, put another gtable can added gtable instead grob.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_grob.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","text":"","code":"gtable_add_grob( x, grobs, t, l, b = t, r = l, z = Inf, clip = \"on\", name = x$name )"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_grob.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","text":"x gtable() object grobs single grob list grobs t numeric vector giving top extent grobs l numeric vector giving left extent grobs b numeric vector giving bottom extent grobs r numeric vector giving right extent grobs z numeric vector giving order grobs plotted. Use Inf (default) plot -Inf existing grobs. default positions integers, giving plenty room insert new grobs existing grobs. clip drawing clipped specified cells (\"\"), entire table (\"inherit\"), (\"\") name name grob - used modify grob name plotted.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_grob.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","text":"gtable object new grob(s) added","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_grob.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a single grob, possibly spanning multiple rows or columns. — gtable_add_grob","text":"","code":"library(grid) gt <- gtable(widths = unit(c(1, 1), 'null'), heights = unit(c(1, 1), 'null')) pts <- pointsGrob(x = runif(5), y = runif(5)) # Add a grob to a single cell (top-right cell) gt <- gtable_add_grob(gt, pts, t = 1, l = 2) # Add a grob spanning multiple cells gt <- gtable_add_grob(gt, pts, t = 1, l = 1, b = 2) plot(gt)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_padding.html","id":null,"dir":"Reference","previous_headings":"","what":"Add padding around edges of table. — gtable_add_padding","title":"Add padding around edges of table. — gtable_add_padding","text":"convenience function adding extra row extra column edge table.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_padding.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add padding around edges of table. — gtable_add_padding","text":"","code":"gtable_add_padding(x, padding)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_padding.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add padding around edges of table. — gtable_add_padding","text":"x gtable() object padding vector length 4: top, right, bottom, left. Normal recycling rules apply.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_padding.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add padding around edges of table. — gtable_add_padding","text":"gtable object","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_padding.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add padding around edges of table. — gtable_add_padding","text":"","code":"library(grid) gt <- gtable(unit(1, \"null\"), unit(1, \"null\")) gt <- gtable_add_grob(gt, rectGrob(gp = gpar(fill = \"black\")), 1, 1) plot(gt) plot(cbind(gt, gt)) plot(rbind(gt, gt)) pad <- gtable_add_padding(gt, unit(1, \"cm\")) plot(pad) plot(cbind(pad, pad)) plot(rbind(pad, pad))"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_rows.html","id":null,"dir":"Reference","previous_headings":"","what":"Add new rows in specified position. — gtable_add_rows","title":"Add new rows in specified position. — gtable_add_rows","text":"Insert new rows gtable adjust grob placement accordingly. rows added middle grob spanning multiple rows, grob continue span . row added grob, grob span new row(s).","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_rows.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add new rows in specified position. — gtable_add_rows","text":"","code":"gtable_add_rows(x, heights, pos = -1)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_rows.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add new rows in specified position. — gtable_add_rows","text":"x gtable() object heights unit vector giving heights new rows pos new row added position. Defaults adding row bottom. 0 adds top.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_rows.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add new rows in specified position. — gtable_add_rows","text":"gtable new rows added.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_rows.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add new rows in specified position. — gtable_add_rows","text":"","code":"library(grid) rect <- rectGrob(gp = gpar(fill = \"#00000080\")) tab <- gtable(unit(rep(1, 3), \"null\"), unit(rep(1, 3), \"null\")) tab <- gtable_add_grob(tab, rect, t = 1, l = 1, r = 3) tab <- gtable_add_grob(tab, rect, t = 1, b = 3, l = 1) tab <- gtable_add_grob(tab, rect, t = 1, b = 3, l = 3) dim(tab) #> [1] 3 3 plot(tab) # Grobs will continue to span over new rows if added in the middle tab2 <- gtable_add_rows(tab, unit(1, \"null\"), 1) dim(tab2) #> [1] 4 3 plot(tab2) # But not when added to top (0) or bottom (-1, the default) tab3 <- gtable_add_rows(tab, unit(1, \"null\")) tab3 <- gtable_add_rows(tab3, unit(1, \"null\"), 0) dim(tab3) #> [1] 5 3 plot(tab3)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_space.html","id":null,"dir":"Reference","previous_headings":"","what":"Add row/column spacing. — gtable_add_space","title":"Add row/column spacing. — gtable_add_space","text":"Adds width space columns height space rows, effictvely pushing existing cells apart.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_space.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add row/column spacing. — gtable_add_space","text":"","code":"gtable_add_col_space(x, width) gtable_add_row_space(x, height)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_space.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add row/column spacing. — gtable_add_space","text":"x gtable object width vector units length 1 ncol - 1 height vector units length 1 nrow - 1","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_space.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add row/column spacing. — gtable_add_space","text":"gtable additional rows columns added","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_add_space.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add row/column spacing. — gtable_add_space","text":"","code":"library(grid) rect <- rectGrob() rect_mat <- matrix(rep(list(rect), 9), nrow = 3) gt <- gtable_matrix(\"rects\", rect_mat, widths = unit(rep(1, 3), \"null\"), heights = unit(rep(1, 3), \"null\")) plot(gt) # Add spacing between the grobs # same height between all rows gt <- gtable_add_row_space(gt, unit(0.5, \"cm\")) # Different width between the columns gt <- gtable_add_col_space(gt, unit(c(0.5, 1), \"cm\")) plot(gt)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a single column gtable — gtable_col","title":"Create a single column gtable — gtable_col","text":"function stacks list grobs single column gtable given width heights.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a single column gtable — gtable_col","text":"","code":"gtable_col( name, grobs, width = NULL, heights = NULL, z = NULL, vp = NULL, clip = \"inherit\" )"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a single column gtable — gtable_col","text":"name string giving name table. used name layout viewport grobs single grob list grobs width unit vector giving width column heights unit vector giving height row z numeric vector giving order grobs plotted. Use Inf (default) plot -Inf existing grobs. default positions integers, giving plenty room insert new grobs existing grobs. vp grid viewport object (NULL). clip drawing clipped specified cells (\"\"), entire table (\"inherit\"), (\"\")","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_col.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a single column gtable — gtable_col","text":"gtable one column many rows elements grobs list.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_col.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a single column gtable — gtable_col","text":"","code":"library(grid) a <- rectGrob(gp = gpar(fill = \"red\")) b <- circleGrob() c <- linesGrob() gt <- gtable_col(\"demo\", list(a, b, c)) gt #> TableGrob (3 x 1) \"demo\": 3 grobs #> z cells name grob #> 1 1 (1-1,1-1) demo rect[GRID.rect.27] #> 2 2 (2-2,1-1) demo circle[GRID.circle.28] #> 3 3 (3-3,1-1) demo lines[GRID.lines.29] plot(gt) gtable_show_layout(gt)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_filter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter cells by name — gtable_filter","title":"Filter cells by name — gtable_filter","text":"Normally gtable considered matrix indexing indexing working cell layout grobs contains. gtable_filter allows subset grobs name optionally remove rows columns left empty subsetting","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_filter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter cells by name — gtable_filter","text":"","code":"gtable_filter(x, pattern, fixed = FALSE, trim = TRUE, invert = FALSE)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_filter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter cells by name — gtable_filter","text":"x gtable object pattern character string containing regular expression (character string fixed = TRUE) matched given character vector. Coerced .character character string possible. character vector length 2 supplied, first element used warning. Missing values allowed except regexpr, gregexpr regexec. fixed logical. TRUE, pattern string matched . Overrides conflicting arguments. trim TRUE, gtable_trim() used trim empty cells. invert filtering inverted cells matching pattern removed instead kept.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_filter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter cells by name — gtable_filter","text":"gtable containing matching grobs, potentially stripped empty columns rows","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_filter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filter cells by name — gtable_filter","text":"","code":"library(grid) gt <- gtable(unit(rep(5, 3), c(\"cm\")), unit(5, \"cm\")) rect <- rectGrob(gp = gpar(fill = \"black\")) circ <- circleGrob(gp = gpar(fill = \"red\")) gt <- gtable_add_grob(gt, rect, 1, 1, name = \"rect\") gt <- gtable_add_grob(gt, circ, 1, 3, name = \"circ\") plot(gtable_filter(gt, \"rect\")) plot(gtable_filter(gt, \"rect\", trim = FALSE)) plot(gtable_filter(gt, \"circ\")) plot(gtable_filter(gt, \"circ\", trim = FALSE))"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_height.html","id":null,"dir":"Reference","previous_headings":"","what":"Returns the height of a gtable, in the gtable's units — gtable_height","title":"Returns the height of a gtable, in the gtable's units — gtable_height","text":"Note unlike heightDetails.gtable, can return relative units.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_height.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Returns the height of a gtable, in the gtable's units — gtable_height","text":"","code":"gtable_height(x)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_height.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Returns the height of a gtable, in the gtable's units — gtable_height","text":"x gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a gtable from a matrix of grobs. — gtable_matrix","title":"Create a gtable from a matrix of grobs. — gtable_matrix","text":"function takes matrix grobs create gtable matching grobs position matrix, given heights widths.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a gtable from a matrix of grobs. — gtable_matrix","text":"","code":"gtable_matrix( name, grobs, widths = NULL, heights = NULL, z = NULL, respect = FALSE, clip = \"on\", vp = NULL )"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a gtable from a matrix of grobs. — gtable_matrix","text":"name string giving name table. used name layout viewport grobs single grob list grobs widths unit vector giving width column heights unit vector giving height row z numeric matrix dimensions grobs, specifying order grobs drawn. respect logical vector length 1: aspect ratio height width specified null units respected. See grid.layout() details clip drawing clipped specified cells (\"\"), entire table (\"inherit\"), (\"\") vp grid viewport object (NULL).","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a gtable from a matrix of grobs. — gtable_matrix","text":"gtable dimensions grobs matrix.","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a gtable from a matrix of grobs. — gtable_matrix","text":"","code":"library(grid) a <- rectGrob(gp = gpar(fill = \"red\")) b <- circleGrob() c <- linesGrob() row <- matrix(list(a, b, c), nrow = 1) col <- matrix(list(a, b, c), ncol = 1) mat <- matrix(list(a, b, c, nullGrob()), nrow = 2) gtable_matrix(\"demo\", row, unit(c(1, 1, 1), \"null\"), unit(1, \"null\")) #> TableGrob (1 x 3) \"demo\": 3 grobs #> z cells name grob #> 1 1 (1-1,1-1) demo rect[GRID.rect.48] #> 2 2 (1-1,2-2) demo circle[GRID.circle.49] #> 3 3 (1-1,3-3) demo lines[GRID.lines.50] gtable_matrix(\"demo\", col, unit(1, \"null\"), unit(c(1, 1, 1), \"null\")) #> TableGrob (3 x 1) \"demo\": 3 grobs #> z cells name grob #> 1 1 (1-1,1-1) demo rect[GRID.rect.48] #> 2 2 (2-2,1-1) demo circle[GRID.circle.49] #> 3 3 (3-3,1-1) demo lines[GRID.lines.50] gtable_matrix(\"demo\", mat, unit(c(1, 1), \"null\"), unit(c(1, 1), \"null\")) #> TableGrob (2 x 2) \"demo\": 4 grobs #> z cells name grob #> 1 1 (1-1,1-1) demo rect[GRID.rect.48] #> 2 2 (2-2,1-1) demo circle[GRID.circle.49] #> 3 3 (1-1,2-2) demo lines[GRID.lines.50] #> 4 4 (2-2,2-2) demo null[GRID.null.51] # Can specify z ordering z <- matrix(c(3, 1, 2, 4), nrow = 2) gtable_matrix(\"demo\", mat, unit(c(1, 1), \"null\"), unit(c(1, 1), \"null\"), z = z) #> TableGrob (2 x 2) \"demo\": 4 grobs #> z cells name grob #> 1 3 (1-1,1-1) demo rect[GRID.rect.48] #> 2 1 (2-2,1-1) demo circle[GRID.circle.49] #> 3 2 (1-1,2-2) demo lines[GRID.lines.50] #> 4 4 (2-2,2-2) demo null[GRID.null.51]"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a single row gtable. — gtable_row","title":"Create a single row gtable. — gtable_row","text":"function puts grobs list side--side single-row gtable left right witrh given widths height.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a single row gtable. — gtable_row","text":"","code":"gtable_row( name, grobs, height = NULL, widths = NULL, z = NULL, vp = NULL, clip = \"inherit\" )"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a single row gtable. — gtable_row","text":"name string giving name table. used name layout viewport grobs single grob list grobs height unit vector giving height row widths unit vector giving width column z numeric vector giving order grobs plotted. Use Inf (default) plot -Inf existing grobs. default positions integers, giving plenty room insert new grobs existing grobs. vp grid viewport object (NULL). clip drawing clipped specified cells (\"\"), entire table (\"inherit\"), (\"\")","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_row.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a single row gtable. — gtable_row","text":"gtable single row number columns elements grobs list","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_row.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a single row gtable. — gtable_row","text":"","code":"library(grid) a <- rectGrob(gp = gpar(fill = \"red\")) b <- circleGrob() c <- linesGrob() gt <- gtable_row(\"demo\", list(a, b, c)) gt #> TableGrob (1 x 3) \"demo\": 3 grobs #> z cells name grob #> 1 1 (1-1,1-1) demo rect[GRID.rect.52] #> 2 2 (1-1,2-2) demo circle[GRID.circle.53] #> 3 3 (1-1,3-3) demo lines[GRID.lines.54] plot(gt) gtable_show_layout(gt)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_show_layout.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualise the layout of a gtable. — gtable_show_layout","title":"Visualise the layout of a gtable. — gtable_show_layout","text":"function simple wrapper around grid::grid.show.layout() allows inspect layout gtable.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_show_layout.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualise the layout of a gtable. — gtable_show_layout","text":"","code":"gtable_show_layout(x, ...)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_show_layout.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualise the layout of a gtable. — gtable_show_layout","text":"x gtable object ... Arguments passed grid::grid.show.layout l Grid layout object. newpage logical value indicating whether move new page drawing diagram. vp.ex positive number, typically \\((0,1]\\), specifying scaling layout. bg colour used background. cell.border colour used draw borders cells layout. cell.fill colour used fill cells layout. cell.label logical indicating whether layout cells labelled. label.col colour used layout cell labels. unit.col colour used labelling widths/heights columns/rows. vp Grid viewport object (NULL).","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_show_layout.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualise the layout of a gtable. — gtable_show_layout","text":"","code":"gt <- gtable(widths = grid::unit(c(1, 0.5, 2), c(\"null\", \"cm\", \"null\")), heights = grid::unit(c(0.2, 1, 3), c(\"inch\", \"null\", \"cm\"))) gtable_show_layout(gt)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_spacer.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a row/col spacer gtable. — gtable_spacer","title":"Create a row/col spacer gtable. — gtable_spacer","text":"Create zero-column zero-row gtable given heights widths respectively.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_spacer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a row/col spacer gtable. — gtable_spacer","text":"","code":"gtable_row_spacer(widths) gtable_col_spacer(heights)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_spacer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a row/col spacer gtable. — gtable_spacer","text":"widths unit vector widths heights unit vector heights","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_spacer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a row/col spacer gtable. — gtable_spacer","text":"gtable object","code":""},{"path":[]},{"path":"https://gtable.r-lib.org/dev/reference/gtable_trim.html","id":null,"dir":"Reference","previous_headings":"","what":"Trim off empty cells. — gtable_trim","title":"Trim off empty cells. — gtable_trim","text":"function detects rows columns contain grobs removes thewm gtable. rows /columns removed non-zero height/width relative layout gtable may change.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_trim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trim off empty cells. — gtable_trim","text":"","code":"gtable_trim(x)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_trim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trim off empty cells. — gtable_trim","text":"x gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_trim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trim off empty cells. — gtable_trim","text":"gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_trim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trim off empty cells. — gtable_trim","text":"","code":"library(grid) rect <- rectGrob(gp = gpar(fill = \"black\")) base <- gtable(unit(c(2, 2, 2), \"cm\"), unit(c(2, 2, 2), \"cm\")) center <- gtable_add_grob(base, rect, 2, 2) plot(center) plot(gtable_trim(center)) col <- gtable_add_grob(base, rect, 1, 2, 3, 2) plot(col) plot(gtable_trim(col)) row <- gtable_add_grob(base, rect, 2, 1, 2, 3) plot(row) plot(gtable_trim(row))"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Returns the width of a gtable, in the gtable's units — gtable_width","title":"Returns the width of a gtable, in the gtable's units — gtable_width","text":"Note unlike widthDetails.gtable, can return relative units.","code":""},{"path":"https://gtable.r-lib.org/dev/reference/gtable_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Returns the width of a gtable, in the gtable's units — gtable_width","text":"","code":"gtable_width(x)"},{"path":"https://gtable.r-lib.org/dev/reference/gtable_width.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Returns the width of a gtable, in the gtable's units — gtable_width","text":"x gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/is.gtable.html","id":null,"dir":"Reference","previous_headings":"","what":"Is this a gtable? — is.gtable","title":"Is this a gtable? — is.gtable","text":"gtable?","code":""},{"path":"https://gtable.r-lib.org/dev/reference/is.gtable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is this a gtable? — is.gtable","text":"","code":"is.gtable(x)"},{"path":"https://gtable.r-lib.org/dev/reference/is.gtable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is this a gtable? — is.gtable","text":"x object test","code":""},{"path":"https://gtable.r-lib.org/dev/reference/print.gtable.html","id":null,"dir":"Reference","previous_headings":"","what":"Print a gtable object — print.gtable","title":"Print a gtable object — print.gtable","text":"Print gtable object","code":""},{"path":"https://gtable.r-lib.org/dev/reference/print.gtable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print a gtable object — print.gtable","text":"","code":"# S3 method for class 'gtable' print(x, zsort = FALSE, ...)"},{"path":"https://gtable.r-lib.org/dev/reference/print.gtable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print a gtable object — print.gtable","text":"x gtable object. zsort Sort z values? Default FALSE. ... arguments (used method).","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-development-version","dir":"Changelog","previous_headings":"","what":"gtable (development version)","title":"gtable (development version)","text":"Added .gtable() S3 method (#97). Add clip argument gtable_col() gtable_row() (#56) Indexing gtable NA now insert zero-dimension row/column position NA-index (#13)","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-035","dir":"Changelog","previous_headings":"","what":"gtable 0.3.5","title":"gtable 0.3.5","text":"CRAN release: 2024-04-22 Fixed partial matching issue constructing viewport gtable() (#94) General upkeep","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-034","dir":"Changelog","previous_headings":"","what":"gtable 0.3.4","title":"gtable 0.3.4","text":"CRAN release: 2023-08-21 Fix package doc links","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-033","dir":"Changelog","previous_headings":"","what":"gtable 0.3.3","title":"gtable 0.3.3","text":"CRAN release: 2023-03-21 Specify minimum rlang version","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-032","dir":"Changelog","previous_headings":"","what":"gtable 0.3.2","title":"gtable 0.3.2","text":"CRAN release: 2023-03-17 General upkeep","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-031","dir":"Changelog","previous_headings":"","what":"gtable 0.3.1","title":"gtable 0.3.1","text":"CRAN release: 2022-09-01 Re-documented fix HTML issues .Rd. gtable re-licensed MIT (#85).","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-030","dir":"Changelog","previous_headings":"","what":"gtable 0.3.0","title":"gtable 0.3.0","text":"CRAN release: 2019-03-25 Made range internal changes increase performance gtable construction, include: Use performant data.frame constructor . Treat layout data.frame list indexing modifying . Use length widths heights fields instead ncol() nrow() internally. Substitute stopifnot(...) (!...) stop(). Better documentation, including new README, vignette performance profiling pkgdown site. New logo now error index gtable non-increasing indices. Dimnames now inherited grobs data gtable_col(), gtable_row(), gtable_matrix() gtable_trim now works empty gtables gtable_filter now invert argument remove grops matching name.","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-020","dir":"Changelog","previous_headings":"","what":"gtable 0.2.0","title":"gtable 0.2.0","text":"CRAN release: 2016-02-26 Switch preDrawDetails() postDrawDetails() methods makeContent() makeContext() methods (@pmur002, #50). better approach facilitiated changes grid. Learn https://journal.r-project.org/archive/2013-2/murrell.pdf. Added NEWS.md file track changes package. Partial argument matches fixed. Import grid instead depending .","code":""},{"path":"https://gtable.r-lib.org/dev/news/index.html","id":"gtable-012","dir":"Changelog","previous_headings":"","what":"gtable 0.1.2","title":"gtable 0.1.2","text":"CRAN release: 2012-12-05 print.gtable now prints z order grobs, longer sort names z order. Previously, layout names sorted z order, grobs weren’t. resulted mismatch names grobs. ’s better sort z default, since doesn’t match indexing works. zsort option allows output sorted z.","code":""}]