#> # A tibble: 5 × 6
#> expression min median `itr/sec` mem_alloc `gc/sec`
#> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl>
-#> 1 heatmap() 147.32ms 164.52ms 4.63 139.11MB 6.95
-#> 2 heatmap.2() 2.27s 2.27s 0.441 224.23MB 0.441
-#> 3 Heatmap() 4.4s 4.4s 0.227 792.59MB 2.95
-#> 4 pheatmap() 870.89ms 870.89ms 1.15 124.1MB 1.15
-#> 5 ggalign() 1.9s 1.9s 0.526 2.51GB 12.1
+#> 1 heatmap() 155.82ms 268.95ms 3.72 139.11MB 5.58
+#> 2 heatmap.2() 2.25s 2.25s 0.444 224.23MB 0.444
+#> 3 Heatmap() 4.25s 4.25s 0.235 792.59MB 2.82
+#> 4 pheatmap() 844.81ms 844.81ms 1.18 124.1MB 1.18
+#> 5 ggalign() 1.83s 1.83s 0.546 2.51GB 12.6
For heatmap with dendrogram
bench::mark(
@@ -215,11 +215,11 @@
+#> 1 heatmap() 2.69s 2.69s 0.372 173.72MB 1.49
+#> 2 heatmap.2() 2.81s 2.81s 0.356 223.41MB 1.07
+#> 3 Heatmap() 5.65s 5.65s 0.177 1.51GB 1.95
+#> 4 pheatmap() 2.26s 2.26s 0.442 177.53MB 0.442
+#> 5 ggalign() 5.25s 5.25s 0.190 2.58GB 4.95
diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml
index 90100ee8..c63f851b 100644
--- a/dev/pkgdown.yml
+++ b/dev/pkgdown.yml
@@ -4,7 +4,7 @@ pkgdown_sha: ~
articles:
articles/benchmarks: benchmarks.html
articles/FAQ: FAQ.html
-last_built: 2025-01-14T09:13Z
+last_built: 2025-01-14T09:18Z
urls:
reference: https://yunuuuu.github.io/ggalign/reference
article: https://yunuuuu.github.io/ggalign/articles
diff --git a/dev/search.json b/dev/search.json
index b54ceb2b..58980f69 100644
--- a/dev/search.json
+++ b/dev/search.json
@@ -1 +1 @@
-[{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/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://yunuuuu.github.io/ggalign/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://yunuuuu.github.io/ggalign/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://yunuuuu.github.io/ggalign/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://yunuuuu.github.io/ggalign/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 yunyunp96@163.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://yunuuuu.github.io/ggalign/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://yunuuuu.github.io/ggalign/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://yunuuuu.github.io/ggalign/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://yunuuuu.github.io/ggalign/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://yunuuuu.github.io/ggalign/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://yunuuuu.github.io/ggalign/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://yunuuuu.github.io/ggalign/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 ggalign 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://yunuuuu.github.io/ggalign/dev/articles/FAQ.html","id":"can-i-change-the-default-data-for-all-geoms","dir":"Articles","previous_headings":"","what":"Can I change the default data for all geoms?","title":"FAQ","text":"function ggalign requires specific data formats operations. need transform filter data individual geoms, can use data argument within geom. However, multiple geoms want consistent transformation applied across , can utilize scheme_data() function allows transform default data additive geoms.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/articles/FAQ.html","id":"why-are-there-spaces-after-setting-all-plot-margin-to-zero","dir":"Articles","previous_headings":"","what":"Why are there spaces after setting all plot.margin to zero?","title":"FAQ","text":"default, ggalign doesn’t add spaces plots. notice spaces, likely due : Plot margins within individual plots. Scale expansion automatically added ggplot2. can resolve removing scale expansion adjusting margins theme:","code":"ggheatmap(small_mat) + anno_top() + align_dendro(aes(color = branch), k = 3L) + scale_y_continuous(expand = expansion()) & theme(plot.margin = margin()) #> → heatmap built with `geom_tile()`"},{"path":"https://yunuuuu.github.io/ggalign/dev/articles/FAQ.html","id":"why-cant-i-add-two-dendrograms-with-different-reorder-settings","dir":"Articles","previous_headings":"","what":"Why can’t I add two dendrograms with different reorder settings?","title":"FAQ","text":"Note: always prevent users reordering layout direction twice. reorder_group = FALSE used, reordering heatmap occurs within group. long ordering within group remains consistent, two dendrograms can placed axis heatmap. Let’s assume panels represents group observation index represents ordered index observations. code provided, panels initialized ungrouped index unordered: add dendrogram reorder_group = FALSE; ’ll something like (Since reorder_group = FALSE, panels won’t changed): However, dendrogram reorder_group = TRUE added, reorder panels, underlying index changed: prevent reordering axis twice, ensure new_index matches index (index NULL). done maintain consistency prevent conflicts ordering heatmap.","code":"panels <- NULL index <- NULL set.seed(2L) group <- sample(letters[1:3], ncol(small_mat), replace = TRUE) h <- ggheatmap(small_mat) + anno_top() + align_group(group) h1 <- h + align_dendro(reorder_group = FALSE, merge_dendrogram = TRUE) # always remember dendrogram will initialize the index, here, we extract the # index from the underlying dendrogram index <- stats::order.dendrogram(ggalign_stat(h1, \"top\", 2L)) h2 <- h + align_dendro(reorder_group = TRUE, merge_dendrogram = TRUE) new_index <- stats::order.dendrogram(ggalign_stat(h2, \"top\", 2L)) all(index == new_index) #> [1] FALSE"},{"path":"https://yunuuuu.github.io/ggalign/dev/articles/FAQ.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"FAQ","text":"","code":"sessionInfo() #> R version 4.4.2 (2024-10-31) #> Platform: x86_64-pc-linux-gnu #> Running under: Ubuntu 24.04.1 LTS #> #> Matrix products: default #> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 #> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0 #> #> locale: #> [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 #> [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 #> [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C #> [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C #> #> time zone: UTC #> tzcode source: system (glibc) #> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: #> [1] ggalign_0.0.5.9000 ggplot2_3.5.1 #> #> loaded via a namespace (and not attached): #> [1] vctrs_0.6.5 cli_3.6.3 knitr_1.49 rlang_1.1.4 #> [5] xfun_0.50 generics_0.1.3 textshaping_0.4.1 jsonlite_1.8.9 #> [9] labeling_0.4.3 glue_1.8.0 colorspace_2.1-1 htmltools_0.5.8.1 #> [13] ragg_1.3.3 sass_0.4.9 scales_1.3.0 rmarkdown_2.29 #> [17] grid_4.4.2 tibble_3.2.1 evaluate_1.0.3 munsell_0.5.1 #> [21] jquerylib_0.1.4 fastmap_1.2.0 yaml_2.3.10 lifecycle_1.0.4 #> [25] compiler_4.4.2 dplyr_1.1.4 fs_1.6.5 pkgconfig_2.0.3 #> [29] farver_2.1.2 systemfonts_1.1.0 digest_0.6.37 R6_2.5.1 #> [33] tidyselect_1.2.1 pillar_1.10.1 magrittr_2.0.3 bslib_0.8.0 #> [37] withr_3.0.2 tools_4.4.2 gtable_0.3.6 pkgdown_2.1.1 #> [41] cachem_1.1.0 desc_1.4.3"},{"path":"https://yunuuuu.github.io/ggalign/dev/articles/benchmarks.html","id":"compared-with-other-packages","dir":"Articles","previous_headings":"","what":"Compared with other packages","title":"Benchmarks","text":"simple heatmap. heatmap dendrogram","code":"bench::mark( \"heatmap()\" = { pdf(NULL) heatmap(mat, Rowv = NA, Colv = NA) dev.off() NULL }, \"heatmap.2()\" = { pdf(NULL) heatmap.2(mat, dendrogram = \"none\", trace = \"none\") dev.off() NULL }, \"Heatmap()\" = { pdf(NULL) draw(Heatmap(mat, cluster_rows = FALSE, cluster_columns = FALSE, use_raster = TRUE )) dev.off() NULL }, \"pheatmap()\" = { pdf(NULL) pheatmap(mat, cluster_rows = FALSE, cluster_cols = FALSE) dev.off() NULL }, \"ggalign()\" = { pdf(NULL) print(ggheatmap(mat, filling = \"raster\")) dev.off() NULL } ) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. #> # A tibble: 5 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 heatmap() 147.32ms 164.52ms 4.63 139.11MB 6.95 #> 2 heatmap.2() 2.27s 2.27s 0.441 224.23MB 0.441 #> 3 Heatmap() 4.4s 4.4s 0.227 792.59MB 2.95 #> 4 pheatmap() 870.89ms 870.89ms 1.15 124.1MB 1.15 #> 5 ggalign() 1.9s 1.9s 0.526 2.51GB 12.1 bench::mark( \"heatmap()\" = { pdf(NULL) heatmap(mat) dev.off() NULL }, \"heatmap.2()\" = { pdf(NULL) heatmap.2(mat, trace = \"none\") dev.off() NULL }, \"Heatmap()\" = { pdf(NULL) draw(Heatmap(mat, row_dend_reorder = FALSE, column_dend_reorder = FALSE, use_raster = TRUE )) dev.off() NULL }, \"pheatmap()\" = { pdf(NULL) pheatmap(mat) dev.off() NULL }, \"ggalign()\" = { pdf(NULL) print(ggheatmap(mat, filling = \"raster\") + anno_top() + align_dendro() + anno_right() + align_dendro()) dev.off() NULL } ) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. #> # A tibble: 5 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 heatmap() 2.98s 2.98s 0.336 173.72MB 1.01 #> 2 heatmap.2() 2.8s 2.8s 0.357 223.41MB 1.07 #> 3 Heatmap() 5.72s 5.72s 0.175 1.51GB 1.57 #> 4 pheatmap() 2.36s 2.36s 0.423 177.53MB 0.423 #> 5 ggalign() 4.66s 4.66s 0.215 2.58GB 4.51"},{"path":"https://yunuuuu.github.io/ggalign/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Yun Peng. Author, maintainer. Shixiang Wang. Author.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Peng Y, Wang S (2025). ggalign: 'ggplot2' Extension Consistent Axis Alignment. R package version 0.0.5.9000, https://yunuuuu.github.io/ggalign/, https://github.com/Yunuuuu/ggalign.","code":"@Manual{, title = {ggalign: A 'ggplot2' Extension for Consistent Axis Alignment}, author = {Yun Peng and Shixiang Wang}, year = {2025}, note = {R package version 0.0.5.9000, https://yunuuuu.github.io/ggalign/}, url = {https://github.com/Yunuuuu/ggalign}, }"},{"path":"https://yunuuuu.github.io/ggalign/dev/index.html","id":"ggalign-","dir":"","previous_headings":"","what":"A ggplot2 Extension for Consistent Axis Alignment","title":"A ggplot2 Extension for Consistent Axis Alignment","text":"package extends ggplot2 providing advanced tools aligning organizing multiple plots, particularly automatically reorder observations, dendrogram. offers fine control layout adjustment plot annotations, enabling create complex, publication-quality visualizations still using familiar grammar ggplot2.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/index.html","id":"why-use-ggalign","dir":"","previous_headings":"","what":"Why use ggalign?","title":"A ggplot2 Extension for Consistent Axis Alignment","text":"ggalign focuses aligning observations across multiple plots. leverages \"number observations\" vctrs package NROW() function maintain consistency plot organization. ’ve ever struggled aligning plots self-contained ordering (like dendrogram), applying consistent grouping ordering across multiple plots (e.g., k-means clustering), ggalign designed make easier. package integrates seamlessly ggplot2, providing flexibility use geoms, scales, components complex visualizations.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"A ggplot2 Extension for Consistent Axis Alignment","text":"can install ggalign CRAN using: Alternatively, install development version r-universe : GitHub :","code":"install.packages(\"ggalign\") install.packages(\"ggalign\", repos = c(\"https://yunuuuu.r-universe.dev\", \"https://cloud.r-project.org\") ) # install.packages(\"remotes\") remotes::install_github(\"Yunuuuu/ggalign\")"},{"path":"https://yunuuuu.github.io/ggalign/dev/index.html","id":"learning-ggalign","dir":"","previous_headings":"","what":"Learning ggalign","title":"A ggplot2 Extension for Consistent Axis Alignment","text":"complete tutorial available : https://yunuuuu.github.io/ggalign-book/ full reference documentation, visit: https://yunuuuu.github.io/ggalign/","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/index.html","id":"acknowledgements","dir":"","previous_headings":"","what":"Acknowledgements","title":"A ggplot2 Extension for Consistent Axis Alignment","text":"like express sincere gratitude contributors ggplot2 project providing powerful flexible framework data visualization R. work laid foundation functionality design package. also like thank patchwork project, core coding plot composer adapted. patchwork library provided useful mechanism combining aligning plots, modified suit needs package. Without contributions open-source projects, package possible. Additionally, like extend heartfelt thanks @teunbrand, fulfilled numerous feature requests, assisted integration new functions ggplot2.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/LayoutProto-class.html","id":null,"dir":"Reference","previous_headings":"","what":"A Layout object — LayoutProto-class","title":"A Layout object — LayoutProto-class","text":"Layout object defines place plots.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/active.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Adding Context Settings — active","title":"Plot Adding Context Settings — active","text":"settings control behavior plot added layout, well arrangement individual plot areas within layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/active.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Adding Context Settings — active","text":"","code":"active(order = waiver(), use = waiver(), name = waiver())"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/active.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Adding Context Settings — active","text":"order integer specifying order plot area within layout. use logical (TRUE/FALSE) indicating whether set active context current plot added layout. TRUE, subsequent ggplot elements applied plot. name string specifying plot's name, useful switching active contexts argument functions like quad_anno()/stack_switch().","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/active.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot Adding Context Settings — active","text":"default, active context set functions add plot areas. allows ggplot2 elements-geoms, stats, scales, themes- seamlessly added current plot area. default ordering plot areas top bottom left right, depending layout orientation. However, users can customize order using order argument.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a New align Object — align","title":"Create a New align Object — align","text":"Align object interacts Layout object reorder split observations , cases, add plot components Layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a New align Object — align","text":"","code":"align( align, data = NULL, ..., plot = NULL, size = NULL, schemes = NULL, no_axes = NULL, active = NULL, call = caller_call() )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a New align Object — align","text":"align Align object. data following options can used: NULL: data set. waiver(): Inherits data layout matrix. function (including purrr-like lambda syntax): Applied layout matrix transform data use. transform final plot data, please use scheme_data(). matrix, data.frame, atomic vector. ... Additional fields passed align object. plot ggplot object. size relative size plot, can specified unit(). Note circle_layout(), size values interpreted relative sizes, layout type adjusts based available space circular arrangement. schemes Options schemes: NULL: Used align add plot. waiver(): Try infer schemes based data. no_axes Logical; TRUE, removes axes elements alignment axis using theme_no_axes(). default, use option- \"ggalign.align_no_axes\". active active() object defines context settings added layout. call call used construct Align object, reporting messages.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a New align Object — align","text":"new ggalign_plot object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a New align Object — align","text":"Align* objects just ggproto() object, descended top-level Align, implements various methods fields. create new type Align* object, typically want override one following: setup_params: Prepare parameter check parameters used plot. setup_data: Prepare data used plot. compute: method used compute statistics. align: method used group observations panel reorder observations. draw: method used draw plot. Must return ggplot object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align.html","id":"discrete-axis-alignment","dir":"Reference","previous_headings":"","what":"Discrete Axis Alignment","title":"Create a New align Object — align","text":"important note consider rows observations, meaning vec_size(data)/NROW(data) must match number observations along axis used alignment (x-axis vertical stack layout, y-axis horizontal stack layout).","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a New align Object — align","text":"","code":"align_dendro() #> #> plot: yes #> reorder: yes #> split: no"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_dendro.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot dendrogram tree — align_dendro","title":"Plot dendrogram tree — align_dendro","text":"Plot dendrogram tree","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_dendro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot dendrogram tree — align_dendro","text":"","code":"align_dendro( mapping = aes(), ..., distance = \"euclidean\", method = \"complete\", use_missing = \"pairwise.complete.obs\", reorder_dendrogram = FALSE, merge_dendrogram = FALSE, reorder_group = FALSE, k = NULL, h = NULL, cutree = NULL, plot_dendrogram = TRUE, plot_cut_height = NULL, root = NULL, center = FALSE, type = \"rectangle\", size = NULL, data = NULL, no_axes = NULL, active = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_dendro.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot dendrogram tree — align_dendro","text":"mapping Default list aesthetic mappings use plot. specified, must supplied layer added plot. ... Additional arguments passed geom_segment(). distance string distance measure used. must one \"euclidean\", \"maximum\", \"manhattan\", \"canberra\", \"binary\" \"minkowski\". Correlation coefficient can also used, including \"pearson\", \"spearman\" \"kendall\". way, 1 - cor used distance. addition, can also provide dist object directly function return dist object. Use NULL, want calculate distance. method string agglomeration method used. (unambiguous abbreviation ) one \"ward.D\", \"ward.D2\", \"single\", \"complete\", \"average\" (= UPGMA), \"mcquitty\" (= WPGMA), \"median\" (= WPGMC) \"centroid\" (= UPGMC). can also provide function accepts calculated distance (input matrix distance NULL) returns hclust object. Alternative, can supply object can coerced hclust. use_missing optional character string giving method computing covariances presence missing values. must (abbreviation ) one strings \"everything\", \".obs\", \"complete.obs\", \"na..complete\", \"pairwise.complete.obs\". used distance correlation coefficient string. reorder_dendrogram single boolean value indicating whether reorder dendrogram based means. Alternatively, can provide custom function accepts hclust object data used generate tree, returning either hclust dendrogram object. Default FALSE. merge_dendrogram single boolean value, indicates whether merge multiple dendrograms, used previous groups established. Default: FALSE. reorder_group single boolean value, indicates whether Hierarchical Clustering groups, used previous groups established. Default: FALSE. k integer scalar indicates desired number groups. h numeric scalar indicates heights tree cut. cutree function used cut hclust tree. accept four arguments: hclust tree object, distance (applicable method string function performing hierarchical clustering), k (number clusters), h (height cut tree). default, cutree() used. plot_dendrogram boolean value indicates whether plot dendrogram tree. plot_cut_height boolean value indicates whether plot cut height. root length one string numeric indicates root branch. center boolean value. TRUE, nodes plotted centered respect leaves/tips branch. Otherwise (default), plot middle direct child nodes. type string indicates plot type, \"rectangle\" \"triangle\". size relative size plot, can specified unit(). Note circle_layout(), size values interpreted relative sizes, layout type adjusts based available space circular arrangement. data matrix-like object. default, inherits layout matrix. no_axes Logical; TRUE, removes axes elements alignment axis using theme_no_axes(). default, use option- \"ggalign.align_no_axes\". active active() object defines context settings added layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_dendro.html","id":"ggplot-specification","dir":"Reference","previous_headings":"","what":"ggplot2 specification","title":"Plot dendrogram tree — align_dendro","text":"align_dendro initializes ggplot data mapping. internal ggplot object always use default mapping aes(x = .data$x, y = .data$y). default ggplot data node coordinates edge data attached ggalign attribute, addition, geom_segment layer data frame edge coordinates added plot_dendrogram = TRUE. See fortify_data_frame.dendrogram() details.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_dendro.html","id":"discrete-axis-alignment","dir":"Reference","previous_headings":"","what":"Discrete Axis Alignment","title":"Plot dendrogram tree — align_dendro","text":"important note consider rows observations, meaning vec_size(data)/NROW(data) must match number observations along axis used alignment (x-axis vertical stack layout, y-axis horizontal stack layout).","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_dendro.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot dendrogram tree — align_dendro","text":"","code":"# align_dendro will always add a plot area ggheatmap(matrix(rnorm(81), nrow = 9)) + anno_top() + align_dendro() #> → heatmap built with `geom_tile()` ggheatmap(matrix(rnorm(81), nrow = 9)) + anno_top() + align_dendro(k = 3L) #> → heatmap built with `geom_tile()`"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_group.html","id":null,"dir":"Reference","previous_headings":"","what":"Group and align observations based on a group vector — align_group","title":"Group and align observations based on a group vector — align_group","text":"Splits observations groups, slice ordering based group levels.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_group.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Group and align observations based on a group vector — align_group","text":"","code":"align_group(group, active = NULL)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_group.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group and align observations based on a group vector — align_group","text":"group character define groups observations. active active() object defines context settings added layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_group.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Group and align observations based on a group vector — align_group","text":"","code":"set.seed(1L) small_mat <- matrix(rnorm(81), nrow = 9) ggheatmap(small_mat) + anno_top() + align_group(sample(letters[1:4], ncol(small_mat), replace = TRUE)) #> → heatmap built with `geom_tile()`"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_hclust.html","id":null,"dir":"Reference","previous_headings":"","what":"Reorder or Group observations based on hierarchical clustering — align_hclust","title":"Reorder or Group observations based on hierarchical clustering — align_hclust","text":"function aligns observations within layout according hierarchical clustering tree, enabling reordering grouping elements based clustering results.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_hclust.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reorder or Group observations based on hierarchical clustering — align_hclust","text":"","code":"align_hclust( distance = \"euclidean\", method = \"complete\", use_missing = \"pairwise.complete.obs\", reorder_dendrogram = FALSE, reorder_group = FALSE, k = NULL, h = NULL, cutree = NULL, data = NULL, active = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_hclust.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reorder or Group observations based on hierarchical clustering — align_hclust","text":"distance string distance measure used. must one \"euclidean\", \"maximum\", \"manhattan\", \"canberra\", \"binary\" \"minkowski\". Correlation coefficient can also used, including \"pearson\", \"spearman\" \"kendall\". way, 1 - cor used distance. addition, can also provide dist object directly function return dist object. Use NULL, want calculate distance. method string agglomeration method used. (unambiguous abbreviation ) one \"ward.D\", \"ward.D2\", \"single\", \"complete\", \"average\" (= UPGMA), \"mcquitty\" (= WPGMA), \"median\" (= WPGMC) \"centroid\" (= UPGMC). can also provide function accepts calculated distance (input matrix distance NULL) returns hclust object. Alternative, can supply object can coerced hclust. use_missing optional character string giving method computing covariances presence missing values. must (abbreviation ) one strings \"everything\", \".obs\", \"complete.obs\", \"na..complete\", \"pairwise.complete.obs\". used distance correlation coefficient string. reorder_dendrogram single boolean value indicating whether reorder dendrogram based means. Alternatively, can provide custom function accepts hclust object data used generate tree, returning either hclust dendrogram object. Default FALSE. reorder_group single boolean value, indicates whether Hierarchical Clustering groups, used previous groups established. Default: FALSE. k integer scalar indicates desired number groups. h numeric scalar indicates heights tree cut. cutree function used cut hclust tree. accept four arguments: hclust tree object, distance (applicable method string function performing hierarchical clustering), k (number clusters), h (height cut tree). default, cutree() used. data matrix-like object. default, inherits layout matrix. active active() object defines context settings added layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_hclust.html","id":"discrete-axis-alignment","dir":"Reference","previous_headings":"","what":"Discrete Axis Alignment","title":"Reorder or Group observations based on hierarchical clustering — align_hclust","text":"important note consider rows observations, meaning vec_size(data)/NROW(data) must match number observations along axis used alignment (x-axis vertical stack layout, y-axis horizontal stack layout).","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_hclust.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reorder or Group observations based on hierarchical clustering — align_hclust","text":"","code":"# align_hclust won't add a dendrogram ggheatmap(matrix(rnorm(81), nrow = 9)) + anno_top() + align_hclust(k = 3L) #> → heatmap built with `geom_tile()`"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_kmeans.html","id":null,"dir":"Reference","previous_headings":"","what":"Split observations by k-means clustering groups. — align_kmeans","title":"Split observations by k-means clustering groups. — align_kmeans","text":"Aligns groups observations based k-means clustering, enabling observation splits cluster groups.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_kmeans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split observations by k-means clustering groups. — align_kmeans","text":"","code":"align_kmeans(..., data = NULL, active = NULL)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_kmeans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split observations by k-means clustering groups. — align_kmeans","text":"... Arguments passed stats::kmeans iter.max maximum number iterations allowed. nstart centers number, many random sets chosen? algorithm character: may abbreviated. Note \"Lloyd\" \"Forgy\" alternative names one algorithm. trace logical integer number, currently used default method (\"Hartigan-Wong\"): positive (true), tracing information progress algorithm produced. Higher values may produce tracing information. data numeric matrix used k-means. default, inherit layout matrix. active active() object defines context settings added layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_kmeans.html","id":"discrete-axis-alignment","dir":"Reference","previous_headings":"","what":"Discrete Axis Alignment","title":"Split observations by k-means clustering groups. — align_kmeans","text":"important note consider rows observations, meaning vec_size(data)/NROW(data) must match number observations along axis used alignment (x-axis vertical stack layout, y-axis horizontal stack layout).","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_kmeans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split observations by k-means clustering groups. — align_kmeans","text":"","code":"ggheatmap(matrix(rnorm(81), nrow = 9)) + anno_top() + align_kmeans(3L) #> → heatmap built with `geom_tile()`"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_order.html","id":null,"dir":"Reference","previous_headings":"","what":"Order observations based on weights — align_order","title":"Order observations based on weights — align_order","text":"Ordering observations based summary weights specified ordering character integer index.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_order.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Order observations based on weights — align_order","text":"","code":"align_order( weights = rowMeans, ..., reverse = FALSE, strict = TRUE, data = NULL, active = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_order.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Order observations based on weights — align_order","text":"weights summary function accepts data returns weights observations. Alternatively, can provide ordering index either integer character. Since characters designated character indices, wish specify function name string, must enclose (). ... Additional arguments passed function provided weights argument. reverse boolean value. sort order reverse? strict boolean value indicates whether order strict. previous groups established, strict FALSE, reorder observations group. data matrix, data frame, atomic vector used input weights function. Alternatively, can specify function (including purrr-like lambda syntax) applied layout matrix, transforming necessary weight calculations. default, inherit layout matrix. active active() object defines context settings added layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_order.html","id":"discrete-axis-alignment","dir":"Reference","previous_headings":"","what":"Discrete Axis Alignment","title":"Order observations based on weights — align_order","text":"important note consider rows observations, meaning vec_size(data)/NROW(data) must match number observations along axis used alignment (x-axis vertical stack layout, y-axis horizontal stack layout).","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_order.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Order observations based on weights — align_order","text":"","code":"ggheatmap(matrix(rnorm(81), nrow = 9)) + anno_left() + align_order(I(\"rowMeans\")) #> → heatmap built with `geom_tile()`"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_panel.html","id":null,"dir":"Reference","previous_headings":"","what":"Create ggplot object with layout panel data — align_panel","title":"Create ggplot object with layout panel data — align_panel","text":"function deprecated realised special case ggalign() function. Please use ggalign(data = NULL) instead.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_panel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create ggplot object with layout panel data — align_panel","text":"","code":"align_panel(...) ggpanel(...)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_phylo.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Phylogenetics tree — align_phylo","title":"Plot Phylogenetics tree — align_phylo","text":"Plot Phylogenetics tree","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_phylo.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Phylogenetics tree — align_phylo","text":"","code":"align_phylo( phylo, ..., ladderize = NULL, type = \"rectangle\", center = FALSE, tree_type = NULL, no_axes = NULL, active = NULL, size = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_phylo.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Phylogenetics tree — align_phylo","text":"phylo phylo object. ... Additional arguments passed geom_segment(). ladderize single string \"left\" \"right\", indicating whether ladderize tree. Ladderizing arranges tree smallest clade positioned \"right\" \"left\". default, NULL means tree ladderized. type string indicates plot type, \"rectangle\" \"triangle\". center boolean value. TRUE, nodes plotted centered respect leaves/tips branch. Otherwise (default), plot middle direct child nodes. tree_type single string, one \"phylogram\" \"cladogram\", indicating type tree. phylogram: Represents phylogenetic tree branch lengths indicate evolutionary distance time. cladogram: Represents tree branch lengths used, branches reflect evolutionary time. Usually, need modify . no_axes Logical; TRUE, removes axes elements alignment axis using theme_no_axes(). default, use option- \"ggalign.align_no_axes\". active active() object defines context settings added layout. size relative size plot, can specified unit(). Note circle_layout(), size values interpreted relative sizes, layout type adjusts based available space circular arrangement.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_plots.html","id":null,"dir":"Reference","previous_headings":"","what":"Arrange multiple plots into a grid — align_plots","title":"Arrange multiple plots into a grid — align_plots","text":"Arrange multiple plots grid","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_plots.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arrange multiple plots into a grid — align_plots","text":"","code":"align_plots( ..., ncol = NULL, nrow = NULL, byrow = TRUE, widths = NA, heights = NA, design = NULL, guides = waiver(), theme = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_plots.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arrange multiple plots into a grid — align_plots","text":"... list plots, ususally ggplot object. Use NULL indicate empty spacer. ncol, nrow dimensions grid create - NULL use logic facet_wrap() set dimensions byrow FALSE plots filled column-major order. widths, heights relative widths heights column row grid. get repeated match dimensions grid. special value NA behave 1null unit unless fixed aspect plot inserted case allow dimension expand contract match aspect ratio content. design Specification location areas layout. Can either specified text string concatenating calls area() together. guides string one \"t\", \"l\", \"b\", \"r\" indicating side guide legends collected. Defaults waiver(), inherits parent layout. parent layout, NULL provided, guides collected. theme theme() object used customize various elements plot, including guides, title, subtitle, caption, margins, panel.border, background. default, theme inherit parent layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_plots.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Arrange multiple plots into a grid — align_plots","text":"alignpatches object.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_plots.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arrange multiple plots into a grid — align_plots","text":"","code":"# directly copied from patchwork p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp)) p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear)) p3 <- ggplot(mtcars) + geom_bar(aes(gear)) + facet_wrap(~cyl) p4 <- ggplot(mtcars) + geom_bar(aes(carb)) p5 <- ggplot(mtcars) + geom_violin(aes(cyl, mpg, group = cyl)) # Either add the plots as single arguments align_plots(p1, p2, p3, p4, p5) # Or use bang-bang-bang to add a list align_plots(!!!list(p1, p2, p3), p4, p5) # Match plots to areas by name design <- \"#BB AA#\" align_plots(B = p1, A = p2, design = design) # Compare to not using named plot arguments align_plots(p1, p2, design = design)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_reorder.html","id":null,"dir":"Reference","previous_headings":"","what":"Reorders layout observations based on specific statistics. — align_reorder","title":"Reorders layout observations based on specific statistics. — align_reorder","text":"Reorders layout observations based specific statistics.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_reorder.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reorders layout observations based on specific statistics. — align_reorder","text":"","code":"align_reorder( stat, ..., reverse = FALSE, strict = TRUE, data = NULL, active = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_reorder.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reorders layout observations based on specific statistics. — align_reorder","text":"stat statistical function accepts data returns statistic, call order2() extract ordering information. ... Additional arguments passed function provided stat argument. reverse boolean value. sort order reverse? strict boolean value indicates whether order strict. previous groups established, strict FALSE, reorder observations group. data matrix, data frame, atomic vector used input stat function. Alternatively, can specify function (including purrr-like lambda syntax) applied layout matrix, transforming necessary statistic calculations. default, inherit layout matrix. active active() object defines context settings added layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_reorder.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Reorders layout observations based on specific statistics. — align_reorder","text":"align_reorder() function differs align_order() weights argument align_order() must return atomic weights observation. contrast, stat argument align_reorder() can return complex structures, hclust dendrogram, among others. Typically, can achieve functionality align_reorder() using align_order() manually extracting ordering information statistic.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_reorder.html","id":"discrete-axis-alignment","dir":"Reference","previous_headings":"","what":"Discrete Axis Alignment","title":"Reorders layout observations based on specific statistics. — align_reorder","text":"important note consider rows observations, meaning vec_size(data)/NROW(data) must match number observations along axis used alignment (x-axis vertical stack layout, y-axis horizontal stack layout).","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/align_reorder.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reorders layout observations based on specific statistics. — align_reorder","text":"","code":"ggheatmap(matrix(rnorm(81), nrow = 9)) + anno_left() + align_reorder(hclust2) #> → heatmap built with `geom_tile()`"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/alignpatch.html","id":null,"dir":"Reference","previous_headings":"","what":"Prepare plots to be aligned with align_plots — alignpatch","title":"Prepare plots to be aligned with align_plots — alignpatch","text":"Prepare plots aligned align_plots","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/alignpatch.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prepare plots to be aligned with align_plots — alignpatch","text":"","code":"alignpatch(x)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/alignpatch.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prepare plots to be aligned with align_plots — alignpatch","text":"x plot object prepared alignment.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/alignpatch.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prepare plots to be aligned with align_plots — alignpatch","text":"Patch object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/alignpatch.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Prepare plots to be aligned with align_plots — alignpatch","text":"ggalign implement alignpatch method following objects: ggplot alignpatches wrapped_plot patch wrapped_patch spacer","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/alignpatch.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prepare plots to be aligned with align_plots — alignpatch","text":"","code":"alignpatch(ggplot()) #> #> add_background: function #> add_plot: function #> align_border: function #> align_free_border: function #> align_panel_sizes: function #> collect_guides: function #> free_border: function #> free_lab: function #> get_sizes: function #> patch_gtable: function #> plot: gg, ggplot #> respect: function #> set_guides: function #> set_theme: function #> split_gt: function #> super: "},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/area.html","id":null,"dir":"Reference","previous_headings":"","what":"Define the plotting areas in align_plots — area","title":"Define the plotting areas in align_plots — area","text":"small helper used specify single area rectangular grid contain plot. Objects constructed area() can concatenated together c() order specify multiple areas.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/area.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define the plotting areas in align_plots — area","text":"","code":"area(t, l, b = t, r = l)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/area.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define the plotting areas in align_plots — area","text":"t, b top bottom bounds area grid l, r left right bounds area int grid","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/area.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define the plotting areas in align_plots — area","text":"ggalign_area object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/area.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define the plotting areas in align_plots — area","text":"grid areas specified reference enumerate rows top bottom, coloumns left right. means t l always less equal b r respectively. Instead specifying area placement combination area() calls, possible instead pass single string equivalent ","code":"areas <- c(area(1, 1, 2, 1), area(2, 3, 3, 3)) areas < -\"A## A#B ##B\""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/area.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Define the plotting areas in align_plots — area","text":"","code":"p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp)) p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear)) p3 <- ggplot(mtcars) + geom_bar(aes(gear)) + facet_wrap(~cyl) layout <- c( area(1, 1), area(1, 3, 3), area(3, 1, 3, 2) ) #> Error in vec_slice(vec_data(x), i): Can't use character names to index an unnamed vector. # Show the layout to make sure it looks as it should plot(layout) #> Error in curve(expr = x, from = from, to = to, xlim = xlim, ylab = ylab, ...): 'expr' did not evaluate to an object of length 'n' # Apply it to a alignpatches align_plots(p1, p2, p3, design = layout) #> Error in as_areas(design): Cannot convert a function into a design area"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cash-LayoutProto-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Subset a Layout object — $,LayoutProto-method","title":"Subset a Layout object — $,LayoutProto-method","text":"Used ggplot_build ggsave","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cash-LayoutProto-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subset a Layout object — $,LayoutProto-method","text":"","code":"# S4 method for class 'LayoutProto' x$name"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cash-LayoutProto-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subset a Layout object — $,LayoutProto-method","text":"x Layout object name string slot name Layout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cash-LayoutProto-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Subset a Layout object — $,LayoutProto-method","text":"slot value.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_continuous.html","id":null,"dir":"Reference","previous_headings":"","what":"Arrange plots in a circular layout by aligning continuous axis — circle_continuous","title":"Arrange plots in a circular layout by aligning continuous axis — circle_continuous","text":"circle_continuous function arranges plots aligning continuous variables circular layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_continuous.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arrange plots in a circular layout by aligning continuous axis — circle_continuous","text":"","code":"circle_continuous( data = NULL, ..., radial = NULL, direction = \"outward\", limits = NULL, theme = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_continuous.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arrange plots in a circular layout by aligning continuous axis — circle_continuous","text":"data Default dataset use layout. specified, must supplied plot added layout, fortify_matrix() used convert data matrix. ... Additional arguments passed fortify_matrix(). radial coord_radial() object defines global parameters coord_radial across plots layout. parameters start, end, direction, expand inherited applied uniformly plots within layout. parameters theta r.axis.inside always ignored set \"x\" TRUE, respectively, plots. direction single string \"inward\" \"outward\", indicating direction plot added. outward: plot added inner outer. inward: plot added outer inner. limits continuous_limits() object specifying left/lower limit right/upper limit scale. Used align continuous axis. theme theme() object used customize various elements layout, including guides, title, subtitle, caption, margins, panel.border, background. default, theme inherit parent layout. also controls panel spacing plots layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_continuous.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arrange plots in a circular layout by aligning continuous axis — circle_continuous","text":"","code":"circle_continuous(mpg, limits = continuous_limits(c(3, 5))) + ggalign(mapping = aes(displ, hwy, colour = class)) + geom_point(size = 2) + ggalign(mapping = aes(displ, hwy, colour = class)) + geom_point(size = 2) & scale_color_brewer(palette = \"Dark2\") & theme_bw()"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_discrete.html","id":null,"dir":"Reference","previous_headings":"","what":"Arrange plots in a circular layout by aligning discrete axis — circle_discrete","title":"Arrange plots in a circular layout by aligning discrete axis — circle_discrete","text":"circle_discrete function arranges plots aligning discrete variables circular layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_discrete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arrange plots in a circular layout by aligning discrete axis — circle_discrete","text":"","code":"circle_discrete( data = NULL, ..., radial = NULL, direction = \"outward\", theme = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_discrete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arrange plots in a circular layout by aligning discrete axis — circle_discrete","text":"data Default dataset use layout. specified, must supplied plot added layout, fortify_matrix() used convert data matrix. ... Additional arguments passed fortify_matrix(). radial coord_radial() object defines global parameters coord_radial across plots layout. parameters start, end, direction, expand inherited applied uniformly plots within layout. parameters theta r.axis.inside always ignored set \"x\" TRUE, respectively, plots. direction single string \"inward\" \"outward\", indicating direction plot added. outward: plot added inner outer. inward: plot added outer inner. theme theme() object used customize various elements layout, including guides, title, subtitle, caption, margins, panel.border, background. default, theme inherit parent layout. also controls panel spacing plots layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_discrete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arrange plots in a circular layout by aligning discrete axis — circle_discrete","text":"","code":"set.seed(123) small_mat <- matrix(rnorm(56), nrow = 7) rownames(small_mat) <- paste0(\"row\", seq_len(nrow(small_mat))) colnames(small_mat) <- paste0(\"column\", seq_len(ncol(small_mat))) # direction outward circle_discrete(small_mat) + align_dendro(aes(color = branch), k = 3L) + scale_color_brewer(palette = \"Dark2\") + ggalign() + geom_tile(aes(y = .column_index, fill = value)) + scale_fill_viridis_c() # direction inward circle_discrete(small_mat, direction = \"inward\") + ggalign() + geom_tile(aes(y = .column_index, fill = value)) + scale_fill_viridis_c() + align_dendro(aes(color = branch), k = 3L) + scale_color_brewer(palette = \"Dark2\")"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_layout.html","id":null,"dir":"Reference","previous_headings":"","what":"Arrange plots in a circular layout — circle_layout","title":"Arrange plots in a circular layout — circle_layout","text":"function integrates functionalities circle_discrete() circle_continuous() single interface.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_layout.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arrange plots in a circular layout — circle_layout","text":"","code":"circle_layout(data = NULL, ..., limits = waiver())"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_layout.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arrange plots in a circular layout — circle_layout","text":"data Default dataset use layout. specified, must supplied plot added layout: limits provided, fortify_matrix() used get matrix. limits specified, fortify_data_frame() used get data frame. Note data matrix, automatically converted long-formatted data frame, differs ggplot2's behavior. ... Additional arguments passed fortify_data_frame(). limits continuous_limits() object specifying left/lower limit right/upper limit scale. Used align continuous axis.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_layout.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Arrange plots in a circular layout — circle_layout","text":"CircleLayout object.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_layout.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arrange plots in a circular layout — circle_layout","text":"","code":"set.seed(123) # circle_discrete small_mat <- matrix(rnorm(56), nrow = 7) rownames(small_mat) <- paste0(\"row\", seq_len(nrow(small_mat))) colnames(small_mat) <- paste0(\"column\", seq_len(ncol(small_mat))) circle_layout(small_mat) + ggalign() + geom_tile(aes(y = .column_index, fill = value)) + scale_fill_viridis_c() + align_dendro(aes(color = branch), k = 3L) + scale_color_brewer(palette = \"Dark2\") # circle_continuous circle_layout(mpg, limits = continuous_limits(c(3, 5))) + ggalign(mapping = aes(displ, hwy, colour = class)) + geom_point(size = 2) + ggalign(mapping = aes(displ, hwy, colour = class)) + geom_point(size = 2) & scale_color_brewer(palette = \"Dark2\") & theme_bw()"},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_switch.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine the active context of circle layout — circle_switch","text":"","code":"circle_switch(radial = waiver(), direction = NULL, what = waiver(), ...)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_switch.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine the active context of circle layout — circle_switch","text":"radial coord_radial() object defines global parameters coord_radial across plots layout. parameters start, end, direction, expand inherited applied uniformly plots within layout. parameters theta r.axis.inside always ignored set \"x\" TRUE, respectively, plots. direction single string \"inward\" \"outward\", indicating direction plot added. outward: plot added inner outer. inward: plot added outer inner. get activated circle_layout()? single number string plot elements layout. NULL, remove active context. ... dots future extensions must empty.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_switch.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine the active context of circle layout — circle_switch","text":"circle_switch object can added circle_layout().","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/circle_switch.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine the active context of circle layout — circle_switch","text":"","code":"set.seed(123) small_mat <- matrix(rnorm(56), nrow = 7) rownames(small_mat) <- paste0(\"row\", seq_len(nrow(small_mat))) colnames(small_mat) <- paste0(\"column\", seq_len(ncol(small_mat))) circle_discrete(small_mat) + ggalign() + geom_tile(aes(y = .column_index, fill = value)) + scale_fill_viridis_c() + align_dendro(aes(color = branch), k = 3L) + scale_color_brewer(palette = \"Dark2\")"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/continuous_limits.html","id":null,"dir":"Reference","previous_headings":"","what":"Set continuous limits for the layout — continuous_limits","title":"Set continuous limits for the layout — continuous_limits","text":"align continuous axes, important keep limits consistent across plots layout. can set limits passing function directly limits xlim/ylim argument, using ... . Alternatively, can add continuous_limits() object layout. quad_layout() function, must specify x/y arguments. layouts, pass limits using ... directly.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/continuous_limits.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set continuous limits for the layout — continuous_limits","text":"","code":"continuous_limits(..., x = waiver(), y = waiver())"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/continuous_limits.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set continuous limits for the layout — continuous_limits","text":"... list two numeric values, specifying left/lower limit right/upper limit scale. x, y ..., specifically quad_layout().","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_link.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a plot to connect selected observations — cross_link","title":"Add a plot to connect selected observations — cross_link","text":"Add plot connect selected observations","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_link.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a plot to connect selected observations — cross_link","text":"","code":"cross_link( link, data = waiver(), ..., on_top = TRUE, obs_size = 1, inherit_index = NULL, inherit_panel = NULL, inherit_nobs = NULL, size = NULL, active = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_link.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a plot to connect selected observations — cross_link","text":"link link_draw() object defines draw links, link_line(). data dataset use layout. default, fortify_matrix() convert data matrix. argument allows change layout data. specified, original data used. ... Additional arguments passed fortify_matrix(). on_top boolean value indicating whether draw link top plot panel (TRUE) (FALSE). obs_size single numeric value indicates size single observation, ranging (0, 1]. inherit_index boolean value indicating whether inherit ordering index. TRUE, match layout ordering index data names. inherit_panel boolean value indicating whether inherit panel group. TRUE, match layout panel data names. inherit_nobs boolean value indicating whether inherit number observations (nobs). TRUE, data input must compatible layout data. size relative size plot, can specified unit(). Note circle_layout(), size values interpreted relative sizes, layout type adjusts based available space circular arrangement. active active() object defines context settings added layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_link.html","id":"ggplot-specification","dir":"Reference","previous_headings":"","what":"ggplot2 Specification","title":"Add a plot to connect selected observations — cross_link","text":"cross_link function initializes ggplot object initialize data. Using scheme_data() change internal data needed.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_mark.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a plot to annotate observations — cross_mark","title":"Add a plot to annotate observations — cross_mark","text":"Add plot annotate observations","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_mark.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a plot to annotate observations — cross_mark","text":"","code":"cross_mark( mark, data = waiver(), ..., obs_size = 1, inherit_index = NULL, inherit_panel = NULL, inherit_nobs = NULL, size = NULL, active = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_mark.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a plot to annotate observations — cross_mark","text":"mark mark_draw() object define draw links. Like mark_line(), mark_tetragon(). Note names pair links used define panel names must unique. data dataset use layout. default, fortify_matrix() convert data matrix. argument allows change layout data. specified, original data used. ... Additional arguments passed fortify_matrix(). obs_size single numeric value indicates size single observation, ranging (0, 1]. inherit_index boolean value indicating whether inherit ordering index. TRUE, match layout ordering index data names. inherit_panel boolean value indicating whether inherit panel group. TRUE, match layout panel data names. inherit_nobs boolean value indicating whether inherit number observations (nobs). TRUE, data input must compatible layout data. size relative size plot, can specified unit(). Note circle_layout(), size values interpreted relative sizes, layout type adjusts based available space circular arrangement. active active() object defines context settings added layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_mark.html","id":"ggplot-specification","dir":"Reference","previous_headings":"","what":"ggplot2 Specification","title":"Add a plot to annotate observations — cross_mark","text":"cross_mark function initializes ggplot object. underlying data contains following columns: .panel: panel aligned axis. means x-axis vertical stack layout (including top bottom annotation), y-axis horizontal stack layout (including left right annotation). .names (vec_names()) .index (vec_size()/NROW()): character names (applicable names exists) integer index original data. .hand: factor levels c(\"left\", \"right\") horizontal stack layouts, c(\"top\", \"bottom\") vertical stack layouts, indicating position linked observations. can use scheme_data() modify internal data needed.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_none.html","id":null,"dir":"Reference","previous_headings":"","what":"Reset layout ordering and panel group — cross_none","title":"Reset layout ordering and panel group — cross_none","text":"Reset layout ordering panel group","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_none.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reset layout ordering and panel group — cross_none","text":"","code":"cross_none( data = waiver(), ..., inherit_index = NULL, inherit_panel = NULL, inherit_nobs = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/cross_none.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reset layout ordering and panel group — cross_none","text":"data dataset use layout. default, fortify_matrix() convert data matrix. argument allows change layout data. specified, original data used. ... Additional arguments passed fortify_matrix(). inherit_index boolean value indicating whether inherit ordering index. TRUE, match layout ordering index data names. inherit_panel boolean value indicating whether inherit panel group. TRUE, match layout panel data names. inherit_nobs boolean value indicating whether inherit number observations (nobs). TRUE, data input must compatible layout data.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/dot-link_draw.html","id":null,"dir":"Reference","previous_headings":"","what":"Define the links to connect a pair of observations — .link_draw","title":"Define the links to connect a pair of observations — .link_draw","text":"base version link_draw(), optimized performance. function serves foundation building link_* functions manage drawing links pairs observations.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/dot-link_draw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define the links to connect a pair of observations — .link_draw","text":"","code":".link_draw(.draw, ...)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/dot-link_draw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define the links to connect a pair of observations — .link_draw","text":".draw function used draw links. function must return grob() object. function return valid grob, drawing occur. input data function list, item data frame containing coordinates pair observations. ... list formulas, side formula integer character index original data, range_link() object defining linked observations. Use NULL indicate link side. can also combine wrapping single list(). left-hand side formula exists, can input directly. integer indices, wrap () use ordering layout. can also use waiver() inherit values group.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/dot-mark_draw.html","id":null,"dir":"Reference","previous_headings":"","what":"Define the links to connect the marked observations — .mark_draw","title":"Define the links to connect the marked observations — .mark_draw","text":"base version mark_draw, designed performance optimization. function used build mark_* functions manage drawing links marked observations.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/dot-mark_draw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define the links to connect the marked observations — .mark_draw","text":"","code":".mark_draw(.draw, ...)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/dot-mark_draw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define the links to connect the marked observations — .mark_draw","text":".draw function used draw links. function must return grob() object. function return valid grob, nothing drawn. input data function contains list, item list two data frames: one panel side coordinates (\"panel\") one marked observations coordinates (\"link\"). ... list formulas, side formula integer character index original data, range_link() object defining linked observations. Use NULL indicate link side. can also combine wrapping single list(). left-hand side formula exists, can input directly. integer indices, wrap () use ordering layout. can also use waiver() inherit values group.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/draw_key_draw.html","id":null,"dir":"Reference","previous_headings":"","what":"Key glyphs for legends — draw_key_draw","title":"Key glyphs for legends — draw_key_draw","text":"geom associated function draws key geom needs displayed legend. functions called draw_key_*(), * stands name respective key glyph. key glyphs can customized individual geoms providing geom key_glyph argument. draw_key_draw function provides interface custom key glyphs used geom_draw().","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/draw_key_draw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Key glyphs for legends — draw_key_draw","text":"","code":"draw_key_draw(data, params, size)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/draw_key_draw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Key glyphs for legends — draw_key_draw","text":"data single row data frame containing scaled aesthetics display key params list additional parameters supplied geom. size Width height key mm.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/draw_key_draw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Key glyphs for legends — draw_key_draw","text":"grid grob.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/draw_key_draw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Key glyphs for legends — draw_key_draw","text":"","code":"p <- ggplot(economics, aes(date, psavert, color = \"savings rate\")) # key glyphs can be specified by their name p + geom_line(key_glyph = \"timeseries\") # key glyphs can be specified via their drawing function p + geom_line(key_glyph = draw_key_rect)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/draw_key_draw2.html","id":null,"dir":"Reference","previous_headings":"","what":"Key glyphs for legends — draw_key_draw2","title":"Key glyphs for legends — draw_key_draw2","text":"geom associated function draws key geom needs displayed legend. functions called draw_key_*(), * stands name respective key glyph. key glyphs can customized individual geoms providing geom key_glyph argument. draw_key_draw2 function provides interface custom key glyphs used geom_draw2().","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/draw_key_draw2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Key glyphs for legends — draw_key_draw2","text":"","code":"draw_key_draw2(data, params, size)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/draw_key_draw2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Key glyphs for legends — draw_key_draw2","text":"data single row data frame containing scaled aesthetics display key params list additional parameters supplied geom. size Width height key mm.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/draw_key_draw2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Key glyphs for legends — draw_key_draw2","text":"grid grob.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/draw_key_draw2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Key glyphs for legends — draw_key_draw2","text":"","code":"p <- ggplot(economics, aes(date, psavert, color = \"savings rate\")) # key glyphs can be specified by their name p + geom_line(key_glyph = \"timeseries\") # key glyphs can be specified via their drawing function p + geom_line(key_glyph = draw_key_rect)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_curve.html","id":null,"dir":"Reference","previous_headings":"","what":"Theme curve elements — element_curve","title":"Theme curve elements — element_curve","text":"Draw curve.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_curve.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Theme curve elements — element_curve","text":"","code":"element_curve( colour = NULL, linewidth = NULL, linetype = NULL, lineend = NULL, color = NULL, curvature = NULL, angle = NULL, ncp = NULL, shape = NULL, arrow = NULL, arrow.fill = NULL, inherit.blank = FALSE )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_curve.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Theme curve elements — element_curve","text":"colour, color Line/border colour. Color alias colour. linewidth Line/border size mm. linetype Line type. integer (0:8), name (blank, solid, dashed, dotted, dotdash, longdash, twodash), string even number (eight) hexadecimal digits give lengths consecutive positions string. lineend Line end Line end style (round, butt, square) curvature numeric value giving amount curvature. Negative values produce left-hand curves, positive values produce right-hand curves, zero produces straight line. angle numeric value 0 180, giving amount skew control points curve. Values less 90 skew curve towards start point values greater 90 skew curve towards end point. ncp number control points used draw curve. control points creates smoother curve. shape numeric vector values -1 1, control shape curve relative control points. See grid.xspline details. arrow list describing arrow heads place either end curve, produced arrow function. arrow.fill Fill colour arrows. inherit.blank element inherit existence element_blank among parents? TRUE existence blank element among parents cause element blank well. FALSE blank parent element ignored calculating final element state.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_curve.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Theme curve elements — element_curve","text":"element_curve object","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_polygon.html","id":null,"dir":"Reference","previous_headings":"","what":"Theme Polygon elements — element_polygon","title":"Theme Polygon elements — element_polygon","text":"Draw polygon.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_polygon.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Theme Polygon elements — element_polygon","text":"","code":"element_polygon( fill = NULL, colour = NULL, linewidth = NULL, linetype = NULL, alpha = NULL, lineend = NULL, linejoin = NULL, linemitre = NULL, color = NULL, inherit.blank = FALSE )"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_polygon.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Theme Polygon elements — element_polygon","text":"fill Fill colour. colour, color Line/border colour. Color alias colour. linewidth Line/border size mm. linetype Line type. integer (0:8), name (blank, solid, dashed, dotted, dotdash, longdash, twodash), string even number (eight) hexadecimal digits give lengths consecutive positions string. alpha transparency value 0 (transparent) 1 (opaque), parallel fill. lineend Line end Line end style (round, butt, square) linejoin Line join style (round, mitre, bevel). linemitre Line mitre limit (number greater 1). inherit.blank element inherit existence element_blank among parents? TRUE existence blank element among parents cause element blank well. FALSE blank parent element ignored calculating final element state.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_polygon.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Theme Polygon elements — element_polygon","text":"element_polygon object","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply a function to the fields of an element object — element_vec","title":"Apply a function to the fields of an element object — element_vec","text":"element object, fields vectorized, others . function allows apply function vectorized fields. following helper functions available: element_rep: Applies rep(). element_rep_len: Applies rep_len(). element_vec_recycle: Applies vec_recycle(). element_vec_rep: Applies vec_rep(). element_vec_rep_each: Applies vec_rep_each(). element_vec_slice: Applies vec_slice().","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply a function to the fields of an element object — element_vec","text":"","code":"element_vec(.el, .fn, ...) element_rep(.el, ...) element_rep_len(.el, length.out, ...) element_vec_recycle(.el, size, ...) element_vec_rep(.el, times, ...) element_vec_rep_each(.el, times, ...) element_vec_slice(.el, i, ...)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/element_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply a function to the fields of an element object — element_vec","text":".el element object. .fn function applied vectorized fields element object. ... Additional arguments passed fn. length.Non-negative integer. desired length output vector. inputs coerced double vector first element taken. Ignored NA invalid. size Desired output size. times vec_rep(), single integer number times repeat entire vector. vec_rep_each(), integer vector number times repeat element x. times recycled size x. integer, character logical vector specifying locations names observations get/set. Specify TRUE index elements (x[]), NULL, FALSE integer() index none (x[NULL]).","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.character.html","id":null,"dir":"Reference","previous_headings":"","what":"Build a data frame — fortify_data_frame.character","title":"Build a data frame — fortify_data_frame.character","text":"function converts various objects data frame.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.character.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build a data frame — fortify_data_frame.character","text":"","code":"# S3 method for class 'character' fortify_data_frame(data, ..., data_arg = caller_arg(data), call = NULL) # S3 method for class 'numeric' fortify_data_frame(data, ..., data_arg = caller_arg(data), call = NULL) # S3 method for class 'logical' fortify_data_frame(data, ..., data_arg = caller_arg(data), call = NULL) # S3 method for class 'complex' fortify_data_frame(data, ..., data_arg = caller_arg(data), call = NULL)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.character.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build a data frame — fortify_data_frame.character","text":"data object converted data frame. ... dots future extensions must empty. data_arg argument name data. Developers can use improve messages. used user. call execution environment data arguments method collected, e.g., caller_env(). Developers can use improve messages. used user.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.character.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build a data frame — fortify_data_frame.character","text":"data frame following columns: .names: names vector (applicable names exist). value: actual value vector.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.default.html","id":null,"dir":"Reference","previous_headings":"","what":"Build a data frame — fortify_data_frame.default","title":"Build a data frame — fortify_data_frame.default","text":"function converts various objects data frame.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.default.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build a data frame — fortify_data_frame.default","text":"","code":"# Default S3 method fortify_data_frame(data, ..., data_arg = caller_arg(data), call = NULL)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.default.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build a data frame — fortify_data_frame.default","text":"data object converted data frame. ... Additional arguments passed fortify(). data_arg argument name data. Developers can use improve messages. used user. call execution environment data arguments method collected, e.g., caller_env(). Developers can use improve messages. used user.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.default.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build a data frame — fortify_data_frame.default","text":"data frame.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.default.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Build a data frame — fortify_data_frame.default","text":"default, calls fortify() build data frame.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.dendrogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Build a data frame — fortify_data_frame.dendrogram","title":"Build a data frame — fortify_data_frame.dendrogram","text":"function converts various objects data frame.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.dendrogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build a data frame — fortify_data_frame.dendrogram","text":"","code":"# S3 method for class 'dendrogram' fortify_data_frame( data, ..., priority = \"right\", center = FALSE, type = \"rectangle\", leaf_pos = NULL, leaf_braches = NULL, reorder_branches = TRUE, branch_gap = NULL, root = NULL, double = TRUE, data_arg = caller_arg(data), call = NULL ) # S3 method for class 'hclust' fortify_data_frame(data, ...)"},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.dendrogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build a data frame — fortify_data_frame.dendrogram","text":"data hclust dendrogram object. ... Additional arguments passed dendrogram method. priority string \"left\" \"right\". draw right left, left override right, take \"left\" priority. draw left right, right override left, take \"right\" priority. used align_dendro() provide support facet operation ggplot2. center boolean value. TRUE, nodes plotted centered respect leaves/tips branch. Otherwise (default), plot middle direct child nodes. type string indicates plot type, \"rectangle\" \"triangle\". leaf_pos x-coordinates leaf node. Must length number observations tree. leaf_braches Branches leaf node. Must length number observations tree. Usually come cutree. reorder_branches single boolean value, indicates whether reorder provided leaf_braches based actual index. branch_gap single numeric value indicates gap different branches. root length one string numeric indicates root branch. double single logical value indicating whether horizontal lines doubled segments span multiple branches. TRUE, horizontal lines repeated branch segment spans. FALSE, one horizontal line drawn. used align_dendro() provide support facet operation ggplot2. data_arg argument name data. Developers can use improve messages. used user. call execution environment data arguments method collected, e.g., caller_env(). Developers can use improve messages. used user.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.dendrogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build a data frame — fortify_data_frame.dendrogram","text":"data frame node coordinates: .panel: Similar panel column, always give correct branch usage ggplot facet. .index: original index tree node label: node label text x y: x-axis y-axis coordinates node branch: branch node . can use column color different groups. panel: panel node , split plot panel using facet_grid, column show panel node . Note: nodes may fall outside panel (two panels), possible NA values column. leaf: logical value indicates whether node leaf.","code":""},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.dendrogram.html","id":"ggalign-attributes","dir":"Reference","previous_headings":"","what":"ggalign attributes","title":"Build a data frame — fortify_data_frame.dendrogram","text":"edge: data frame edge coordinates: .panel: Similar panel column, always give correct branch usage ggplot facet. x y: x-axis y-axis coordinates start node edge. xend yend: x-axis y-axis coordinates terminal node edge. branch: branch edge . can use column color different groups. panel1 panel2: panel1 panel2 columns functionality panel, specifically edge data correspond nodes edge.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/dev/reference/fortify_data_frame.dendrogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Build a data frame — fortify_data_frame.dendrogram","text":"","code":"fortify_data_frame(hclust(dist(USArrests), \"ave\")) #> .index label x y branch leaf panel .panel #> 1 9 Florida 1.000000 0.000000 root TRUE #> 2 33 North Carolina 2.000000 0.000000 root TRUE #> 3 NA 1.500000 38.527912 root FALSE #> 4 5 California 3.000000 0.000000 root TRUE #> 5 20 Maryland 4.000000 0.000000 root TRUE #> 6 3 Arizona 5.000000 0.000000 root TRUE #> 7 31 New Mexico 6.000000 0.000000 root TRUE #> 8 NA 5.500000 13.896043 root FALSE #> 9 NA 4.750000 15.453120 root FALSE #> 10 NA 3.875000 28.012211 root FALSE #> 11 8 Delaware 7.000000 0.000000 root TRUE #> 12 1 Alabama 8.000000 0.000000 root TRUE #> 13 18 Louisiana 9.000000 0.000000 root TRUE #> 14 NA 8.500000 15.454449 root FALSE #> 15 NA 7.750000 16.891499 root FALSE #> 16 13 Illinois 10.000000 0.000000 root TRUE #> 17 32 New York 11.000000 0.000000 root TRUE #> 18 NA 10.500000 6.236986 root FALSE #> 19 22 Michigan 12.000000 0.000000 root TRUE #> 20 28 Nevada 13.000000 0.000000 root TRUE #> 21 NA 12.500000 13.297368 root FALSE #> 22 NA 11.500000 18.417331 root FALSE #> 23 NA 9.625000 26.363428 root FALSE #> 24 2 Alaska 14.000000 0.000000 root TRUE #> 25 24 Mississippi 15.000000 0.000000 root TRUE #> 26 40 South Carolina 16.000000 0.000000 root TRUE #> 27 NA 15.500000 21.167192 root FALSE #> 28 NA 14.750000 28.095803 root FALSE #> 29 NA 12.187500 39.394633 root FALSE #> 30 NA 8.031250 44.283922 root FALSE #> 31 NA 4.765625 77.605024 root FALSE #> 32 47 Washington 17.000000 0.000000 root TRUE #> 33 37 Oregon 18.000000 0.000000 root TRUE #> 34 50 Wyoming 19.000000 0.000000 root TRUE #> 35 36 Oklahoma 20.000000 0.000000 root TRUE #> 36 46 Virginia 21.000000 0.000000 root TRUE #> 37 NA 20.500000 7.355270 root FALSE #> 38 NA 19.750000 10.736739 root FALSE #> 39 NA 18.875000 12.878100 root FALSE #> 40 NA 17.937500 16.425489 root FALSE #> 41 39 Rhode Island 22.000000 0.000000 root TRUE #> 42 21 Massachusetts 23.000000 0.000000 root TRUE #> 43 30 New Jersey 24.000000 0.000000 root TRUE #> 44 NA 23.500000 11.456439 root FALSE #> 45 NA 22.750000 22.595978 root FALSE #> 46 NA 20.343750 26.713777 root FALSE #> 47 25 Missouri 25.000000 0.000000 root TRUE #> 48 4 Arkansas 26.000000 0.000000 root TRUE #> 49 42 Tennessee 27.000000 0.000000 root TRUE #> 50 NA 26.500000 12.614278 root FALSE #> 51 NA 25.750000 20.198479 root FALSE #> 52 10 Georgia 28.000000 0.000000 root TRUE #> 53 6 Colorado 29.000000 0.000000 root TRUE #> 54 43 Texas 30.000000 0.000000 root TRUE #> 55 NA 29.500000 14.501034 root FALSE #> 56 NA 28.750000 23.972143 root FALSE #> 57 NA 27.250000 29.054195 root FALSE #> 58 NA 23.796875 44.837933 root FALSE #> 59 12 Idaho 31.000000 0.000000 root TRUE #> 60 27 Nebraska 32.000000 0.000000 root TRUE #> 61 17 Kentucky 33.000000 0.000000 root TRUE #> 62 26 Montana 34.000000 0.000000 root TRUE #> 63 NA 33.500000 3.834058 root FALSE #> 64 NA 32.750000 12.438692 root FALSE #> 65 NA 31.875000 15.026107 root FALSE #> 66 35 Ohio 35.000000 0.000000 root TRUE #> 67 44 Utah 36.000000 0.000000 root TRUE #> 68 NA 35.500000 6.637771 root FALSE #> 69 14 Indiana 37.000000 0.000000 root TRUE #> 70 16 Kansas 38.000000 0.000000 root TRUE #> 71 NA 37.500000 3.929377 root FALSE #> 72 7 Connecticut 39.000000 0.000000 root TRUE #> 73 38 Pennsylvania 40.000000 0.000000 root TRUE #> 74 NA 39.500000 8.027453 root FALSE #> 75 NA 38.500000 13.352260 root FALSE #> 76 NA 37.000000 15.122897 root FALSE #> 77 NA 34.437500 20.598507 root FALSE #> 78 11 Hawaii 41.000000 0.000000 root TRUE #> 79 48 West Virginia 42.000000 0.000000 root TRUE #> 80 19 Maine 43.000000 0.000000 root TRUE #> 81 41 South Dakota 44.000000 0.000000 root TRUE #> 82 NA 43.500000 8.537564 root FALSE #> 83 NA 42.750000 10.771175 root FALSE #> 84 34 North Dakota 45.000000 0.000000 root TRUE #> 85 45 Vermont 46.000000 0.000000 root TRUE #> 86 NA 45.500000 13.044922 root FALSE #> 87 23 Minnesota 47.000000 0.000000 root TRUE #> 88 49 Wisconsin 48.000000 0.000000 root TRUE #> 89 15 Iowa 49.000000 0.000000 root TRUE #> 90 29 New Hampshire 50.000000 0.000000 root TRUE #> 91 NA 49.500000 2.291288 root FALSE #> 92 NA 48.750000 10.184218 root FALSE #> 93 NA 47.875000 18.993398 root FALSE