diff --git a/pkgdown.yml b/pkgdown.yml
index be561c2f..5a98e280 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -7,7 +7,7 @@ articles:
ComplexHeatmap-Single-Heatmap: ComplexHeatmap-Single-Heatmap.html
layout-heatmap: layout-heatmap.html
layout-stack: layout-stack.html
-last_built: 2024-08-08T13:21Z
+last_built: 2024-08-08T13:23Z
urls:
reference: https://yunuuuu.github.io/ggalign/reference
article: https://yunuuuu.github.io/ggalign/articles
diff --git a/reference/align_gg-1.png b/reference/align_gg-1.png
index c574ec41..37ffef83 100644
Binary files a/reference/align_gg-1.png and b/reference/align_gg-1.png differ
diff --git a/reference/align_panel.html b/reference/align_panel.html
index f7623f22..6dad63de 100644
--- a/reference/align_panel.html
+++ b/reference/align_panel.html
@@ -1,5 +1,5 @@
-
Setup Layout
diff --git a/search.json b/search.json
index 0338f5bb..e977a9c9 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://yunuuuu.github.io/ggalign/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/articles/ComplexHeatmap-Single-Heatmap.html","id":"colors","dir":"Articles","previous_headings":"","what":"Colors","title":"ComplexHeamtap-Single-Heatmap","text":"ComplexHeatmap reorder dendrogram default, align_dendro won’t change tree layout. following codes, hypothesized arguments row_dend_reorder column_dend_reorder ComplexHeatmap::Heatmap FALSE. important note ggalign considers left-bottom starting point, ComplexHeatmap considers left-top starting point. scale_fill_* function ggplot2 makes easy modify colors. oob argument scale_fill_* function can used deal outliers. Heatmap can built patchwork object, can use patchwork arrange . character matrix, can use ggplot2 discrete filling scales. won’t compare LAB RGB space. want convert color different color space, try use (farver)[https://farver.data-imaginist.com/] pacakge. ggplot2, can use panel.border argument theme() function control Heatmap body border. Heatmap cell border, just decrease cell width height. can also use color aesthetic specify cell border color linewidth aesthetic specify border width.","code":"dim(mat) #> [1] 18 24 ggheatmap(mat) + scale_fill_gradient2(low = \"#2600D1FF\", high = \"#EE3F3FFF\") + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) # ComplexHeatmap::Heatmap(mat, # row_dend_reorder = FALSE, # column_dend_reorder = FALSE # ) ggheatmap(mat) + scale_fill_gradient2(low = \"green\", high = \"red\") + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) mat2 <- mat mat2[1, 1] <- 100000 ggheatmap(mat2) + scale_fill_gradient2( low = \"green\", high = \"red\", limits = c(-2, 2), oob = scales::squish ) + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + theme(axis.text.x = element_text(angle = -60, hjust = 0)) + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) h1 <- ggheatmap(mat) + scale_fill_gradient2(name = \"mat\", low = \"green\", high = \"red\") + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + theme(axis.text.x = element_text(angle = -60, hjust = 0)) + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) h2 <- ggheatmap(mat / 4) + scale_fill_gradient2( name = \"mat/4\", limits = c(-2, 2L), oob = scales::squish, low = \"green\", high = \"red\" ) + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + theme(axis.text.x = element_text(angle = -60, hjust = 0)) + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) h3 <- ggheatmap(abs(mat)) + scale_fill_gradient2(name = \"abs(mat)\", low = \"green\", high = \"red\") + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + theme(axis.text.x = element_text(angle = -60, hjust = 0)) + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) patchwork::wrap_plots( build_patchwork(h1), build_patchwork(h2), build_patchwork(h3), ncol = 2L ) ggheatmap(mat) + scale_fill_gradientn(colors = rev(rainbow(10))) + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) discrete_mat <- matrix(sample(1:4, 100, replace = TRUE), 10, 10) colors <- structure(1:4, names = c(\"1\", \"2\", \"3\", \"4\")) # black, red, green, blue ggheatmap(discrete_mat, filling = FALSE) + geom_tile(aes(fill = factor(value))) + scale_fill_manual(values = colors) + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) discrete_mat <- matrix(sample(letters[1:4], 100, replace = TRUE), 10, 10) colors <- structure(1:4, names = letters[1:4]) ggheatmap(discrete_mat) + scale_fill_manual(values = colors) mat_with_na <- mat na_index <- sample(c(TRUE, FALSE), nrow(mat) * ncol(mat), replace = TRUE, prob = c(1, 9) ) mat_with_na[na_index] <- NA ggheatmap(mat_with_na) + scale_fill_gradient2( low = \"#2600D1FF\", high = \"#EE3F3FFF\", na.value = \"black\" ) + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) ggheatmap(mat) + scale_fill_gradient2(low = \"#2600D1FF\", high = \"#EE3F3FFF\") + theme(panel.border = element_rect(linetype = \"dashed\", fill = NA)) + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) ggheatmap(mat, filling = FALSE) + geom_tile(aes(fill = value), width = 0.95, height = 0.95) + scale_fill_gradient2(low = \"#2600D1FF\", high = \"#EE3F3FFF\") + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) ggheatmap(mat, filling = FALSE) + geom_tile(aes(fill = value), color = \"white\") + scale_fill_gradient2(low = \"#2600D1FF\", high = \"#EE3F3FFF\") + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin()) ggheatmap(mat, filling = FALSE) + hmanno(\"r\", size = unit(15, \"mm\")) + align_dendro() + hmanno(\"t\", size = unit(15, \"mm\")) + align_dendro() + hmanno(NULL) & theme(plot.margin = margin())"},{"path":"https://yunuuuu.github.io/ggalign/articles/ComplexHeatmap-Single-Heatmap.html","id":"session-information","dir":"Articles","previous_headings":"Colors","what":"Session information","title":"ComplexHeamtap-Single-Heatmap","text":"","code":"sessionInfo() #> R version 4.4.1 (2024-06-14) #> Platform: x86_64-pc-linux-gnu #> Running under: Ubuntu 22.04.4 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.20.so; LAPACK version 3.10.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.1 ggplot2_3.5.1 #> #> loaded via a namespace (and not attached): #> [1] gtable_0.3.5 jsonlite_1.8.8 highr_0.11 dplyr_1.1.4 #> [5] compiler_4.4.1 tidyselect_1.2.1 tidyr_1.3.1 jquerylib_0.1.4 #> [9] systemfonts_1.1.0 scales_1.3.0 textshaping_0.4.0 yaml_2.3.10 #> [13] fastmap_1.2.0 R6_2.5.1 labeling_0.4.3 generics_0.1.3 #> [17] patchwork_1.2.0 knitr_1.48 tibble_3.2.1 desc_1.4.3 #> [21] munsell_0.5.1 bslib_0.8.0 pillar_1.9.0 rlang_1.1.4 #> [25] utf8_1.2.4 cachem_1.1.0 xfun_0.46 fs_1.6.4 #> [29] sass_0.4.9 cli_3.6.3 pkgdown_2.1.0 withr_3.0.1 #> [33] magrittr_2.0.3 digest_0.6.36 grid_4.4.1 lifecycle_1.0.4 #> [37] vctrs_0.6.5 evaluate_0.24.0 glue_1.7.0 farver_2.1.2 #> [41] ragg_1.3.2 fansi_1.0.6 colorspace_2.1-1 purrr_1.0.2 #> [45] rmarkdown_2.27 tools_4.4.1 pkgconfig_2.0.3 htmltools_0.5.8.1"},{"path":"https://yunuuuu.github.io/ggalign/articles/ComplexHeatmap-gene-expression-matrix.html","id":"add-more-information-for-gene-expression-matrix","dir":"Articles","previous_headings":"","what":"Add more information for gene expression matrix","title":"ComplexHeatmap-gene-expression-matrix","text":"","code":"expr <- readRDS(system.file(package = \"ComplexHeatmap\", \"extdata\", \"gene_expression.rds\")) mat <- as.matrix(expr[, grep(\"cell\", colnames(expr))]) base_mean <- rowMeans(mat) mat_scaled <- t(apply(mat, 1, scale)) type <- gsub(\"s\\\\d+_\", \"\", colnames(mat)) ggstack(data = mat_scaled) + align_kmeans(centers = 5L) + ggpanel(size = unit(1, \"cm\")) + geom_tile(aes(x = 1, fill = factor(.panel))) + scale_fill_brewer(palette = \"Dark2\", name = \"Kmeans group\") + scale_x_continuous(breaks = NULL, name = NULL) + ggheatmap() + scale_y_continuous(breaks = NULL) + scale_fill_viridis_c() + hmanno(\"t\") + align_dendro() + ggalign(data = type, size = unit(1, \"cm\")) + geom_tile(aes(y = 1, fill = factor(value))) + scale_y_continuous(breaks = NULL, name = NULL) + scale_fill_brewer(palette = \"Set1\", name = \"type\") + hmanno() + ggheatmap(base_mean, width = unit(2, \"cm\")) + scale_y_continuous(breaks = NULL) + scale_x_continuous(name = \"base mean\", breaks = FALSE) + scale_fill_gradientn(colours = c(\"#2600D1FF\", \"white\", \"#EE3F3FFF\")) + hmanno(\"t\", size = unit(4, \"cm\")) + ggalign() + geom_boxplot(aes(y = value, fill = factor(.extra_panel))) + scale_x_continuous(expand = expansion(), breaks = NULL) + scale_fill_brewer(palette = \"Dark2\", guide = \"none\") + theme(axis.title.y = element_blank()) + # we reset heatmap context into heatmap body, in this way, # `&` will add elemnets for this heatmap and heatmap annotation simutaneously hmanno() + active() + ggalign(data = expr$length, size = unit(2, \"cm\")) + geom_point(aes(x = value)) + labs(x = \"length\") + theme( panel.border = element_rect(fill = NA), axis.text.x = element_text(angle = -60, hjust = 0) ) + ggheatmap(expr$type, width = unit(2, \"cm\")) + scale_fill_brewer(palette = \"Set3\", name = \"gene type\") + scale_x_continuous(breaks = NULL, name = \"gene type\") + hmanno(\"t\") + ggalign(limits = FALSE) + geom_bar( aes(.extra_panel, fill = factor(value)), position = position_fill() ) + scale_x_discrete() + scale_y_continuous(expand = expansion()) + scale_fill_brewer(palette = \"Set3\", name = \"gene type\", guide = \"none\") & theme(plot.margin = margin())"},{"path":"https://yunuuuu.github.io/ggalign/articles/ComplexHeatmap-gene-expression-matrix.html","id":"the-measles-vaccine-heatmap","dir":"Articles","previous_headings":"","what":"The measles vaccine heatmap","title":"ComplexHeatmap-gene-expression-matrix","text":"","code":"mat <- readRDS(system.file(\"extdata\", \"measles.rds\", package = \"ComplexHeatmap\" )) ggheatmap(mat, filling = FALSE) + geom_tile(aes(fill = value), color = \"white\") + scale_fill_gradientn( colours = c(\"white\", \"cornflowerblue\", \"yellow\", \"red\"), values = scales::rescale(c(0, 800, 1000, 127000), c(0, 1)) ) + theme(axis.text.x = element_text(angle = -60, hjust = 0)) + hmanno(\"r\") + align_dendro(plot_dendrogram = FALSE) + hmanno(\"t\", size = unit(2, \"cm\")) + ggalign(data = rowSums) + geom_bar(aes(y = value), fill = \"#FFE200\", stat = \"identity\") + scale_y_continuous(expand = expansion()) + ggtitle(\"Measles cases in US states 1930-2001\\nVaccine introduced 1961\") + theme(plot.title = element_text(hjust = 0.5)) + hmanno(\"r\", size = unit(2, \"cm\")) + ggalign(data = rowSums) + geom_bar(aes(x = value), fill = \"#FFE200\", stat = \"identity\", orientation = \"y\" ) + scale_x_continuous(expand = expansion()) + theme(axis.text.x = element_text(angle = -60, hjust = 0))"},{"path":"https://yunuuuu.github.io/ggalign/articles/ComplexHeatmap-gene-expression-matrix.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"ComplexHeatmap-gene-expression-matrix","text":"","code":"sessionInfo() #> R version 4.4.1 (2024-06-14) #> Platform: x86_64-pc-linux-gnu #> Running under: Ubuntu 22.04.4 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.20.so; LAPACK version 3.10.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.1 ggplot2_3.5.1 #> #> loaded via a namespace (and not attached): #> [1] gtable_0.3.5 jsonlite_1.8.8 highr_0.11 dplyr_1.1.4 #> [5] compiler_4.4.1 tidyselect_1.2.1 tidyr_1.3.1 jquerylib_0.1.4 #> [9] systemfonts_1.1.0 scales_1.3.0 textshaping_0.4.0 ggh4x_0.2.8 #> [13] yaml_2.3.10 fastmap_1.2.0 R6_2.5.1 labeling_0.4.3 #> [17] generics_0.1.3 patchwork_1.2.0 knitr_1.48 tibble_3.2.1 #> [21] desc_1.4.3 munsell_0.5.1 RColorBrewer_1.1-3 bslib_0.8.0 #> [25] pillar_1.9.0 rlang_1.1.4 utf8_1.2.4 cachem_1.1.0 #> [29] xfun_0.46 fs_1.6.4 sass_0.4.9 viridisLite_0.4.2 #> [33] cli_3.6.3 pkgdown_2.1.0 withr_3.0.1 magrittr_2.0.3 #> [37] digest_0.6.36 grid_4.4.1 lifecycle_1.0.4 vctrs_0.6.5 #> [41] evaluate_0.24.0 glue_1.7.0 farver_2.1.2 ragg_1.3.2 #> [45] fansi_1.0.6 colorspace_2.1-1 purrr_1.0.2 rmarkdown_2.27 #> [49] tools_4.4.1 pkgconfig_2.0.3 htmltools_0.5.8.1"},{"path":"https://yunuuuu.github.io/ggalign/articles/align.html","id":"align_","dir":"Articles","previous_headings":"","what":"align_*","title":"align","text":"ggalign package provides range align_* functions enable control layout. Specifically, functions allow manipulation axis order layout, well partitioning along single axis multiple panel. Additionally, functions capability add plots. Currently, four primary align_* functions: align_group, align_reorder, align_kmeans align_dendro.","code":"set.seed(123) small_mat <- matrix(rnorm(81), nrow = 9) rownames(small_mat) <- paste0(\"row\", seq_len(nrow(small_mat))) colnames(small_mat) <- paste0(\"column\", seq_len(ncol(small_mat)))"},{"path":"https://yunuuuu.github.io/ggalign/articles/align.html","id":"align_group","dir":"Articles","previous_headings":"align_*","what":"align_group","title":"align","text":"align_group just group along layout axis different panel. won’t add plot area. default, facet strip text removed, can override behaviour theme(strip.text = element_text()). align_group plot area, can add panel title heatmap plot.","code":"ggheatmap(small_mat) + hmanno(\"t\") + align_group(sample(letters[1:4], ncol(small_mat), replace = TRUE)) ggheatmap(small_mat) + theme(strip.text = element_text()) + hmanno(\"l\") + align_group(sample(letters[1:4], nrow(small_mat), replace = TRUE))"},{"path":"https://yunuuuu.github.io/ggalign/articles/align.html","id":"align_reorder","dir":"Articles","previous_headings":"align_*","what":"align_reorder","title":"align","text":"align_reorder reorder layout rows/columns based summary function. won’t add plot area. align_* functions accept data argument. argument can matrix, data frame, even simple vector converted one-column matrix. data argument set NULL, function use layout data, shown previous example. Additionally, data argument can also accept function (purrr-like lambda also okay), applied layout data. important note align_* function consider rows observations. means NROW function must return number layout parallel axis. heatmap column annotation, heatmap matrix transposed using (data function, applied transposed matrix). even top bottom annotation, can also use rowMeans calculate mean value across columns.","code":"ggheatmap(small_mat) + hmanno(\"l\") + align_reorder(rowMeans) ggheatmap(small_mat) + hmanno(\"t\") + align_reorder(rowMeans)"},{"path":"https://yunuuuu.github.io/ggalign/articles/align.html","id":"align_kmeans","dir":"Articles","previous_headings":"align_*","what":"align_kmeans","title":"align","text":"align_kmeans group heatmap rows/columns kmeans. won’t add plot area. important note align_group align_kmeans sub-groups. means use groups exist.","code":"ggheatmap(small_mat) + hmanno(\"t\") + align_kmeans(3L) ggheatmap(small_mat) + hmanno(\"t\") + align_group(sample(letters[1:4], ncol(small_mat), replace = TRUE)) + align_kmeans(3L) #> Error in `align_kmeans()`: #> ! `align_kmeans()` cannot do sub-split #> ℹ Group of layout x-axis already exists ggheatmap(small_mat) + hmanno(\"t\") + align_kmeans(3L) + align_group(sample(letters[1:4], ncol(small_mat), replace = TRUE)) #> Error in `align_group()`: #> ! `align_group()` cannot do sub-split #> ℹ Group of layout x-axis already exists"},{"path":"https://yunuuuu.github.io/ggalign/articles/align.html","id":"align_dendro","dir":"Articles","previous_headings":"align_* > align_kmeans","what":"align_dendro","title":"align","text":"align_dendro class addition dendrogram near heatmap can also reorder heatmap. primarily useful working heatmap plots. can use distance method argument control dendrogram builind proce. One useful function dendrogram cut columns/rows groups. can specify k h, works cutree. contrast align_group, align_kmeans, align_reorder, align_dendro capable drawing plot components. Therefore, default set_context value TRUE, indicates whether set active context current Align object. Consequently, ggplot elements added thereafter included plot area. align_dendro create default node data ggplot. See ?dendrogram_data details. addition, edge data added geom_segment layer directly used draw dendrogram tree. One useful variable node edge data branch column, corresponding cutree result. align_dendro also capable performing clustering groups. means can use even already existing groups present layout. can reorder groups setting reorder_group = TRUE. can see difference. important understand reorder_group = FALSE used, reordering heatmap occurs within group. long ordering within group remains , two dendrograms can placed axis heatmap. adding dendrogram reorder_group = FALSE behind dendrogram reorder_group = TRUE acceptable, second align_dendro follow group ordering established first one. However, possible add dendrogram reorder_group = TRUE behind dendrogram reorder_group = FALSE second dendrogram able conform grouping order followed first dendrogram. always prevent users reordering layout axis twice.","code":"ggheatmap(small_mat) + hmanno(\"t\") + align_dendro() ggheatmap(small_mat) + hmanno(\"t\") + align_dendro(method = \"ward.D2\") ggheatmap(small_mat) + hmanno(\"t\") + align_dendro(k = 3L) ggheatmap(small_mat) + hmanno(\"t\") + align_dendro() + geom_point(aes(y = y)) ggheatmap(small_mat) + hmanno(\"t\") + align_dendro(aes(color = branch), k = 3) + geom_point(aes(color = branch, y = y)) column_groups <- sample(letters[1:3], ncol(small_mat), replace = TRUE) ggheatmap(small_mat) + hmanno(\"t\") + align_group(column_groups) + align_dendro(aes(color = branch)) ggheatmap(small_mat) + hmanno(\"t\") + align_group(column_groups) + align_dendro(aes(color = branch), reorder_group = TRUE) ggheatmap(small_mat) + hmanno(\"t\") + align_group(column_groups) + align_dendro(aes(color = branch), reorder_group = TRUE) + hmanno(\"b\") + align_dendro(aes(color = branch), reorder_group = FALSE) ggheatmap(small_mat) + hmanno(\"t\") + align_group(column_groups) + align_dendro(aes(color = branch), reorder_group = FALSE) + hmanno(\"b\") + align_dendro(aes(color = branch), reorder_group = TRUE) #> Error in `align_dendro()`: #> ! `align_dendro()` disrupt the previously established order of the #> layout x-axis"},{"path":"https://yunuuuu.github.io/ggalign/articles/align.html","id":"align_gg","dir":"Articles","previous_headings":"align_*","what":"align_gg","title":"align","text":"align_gg similar ggplot initializes ggplot data mapping. data input can matrix, data frame, simple vector converted one-column matrix, can inherit heatmap matrix. internal always use default mapping parallel axis layout (aes(y = .data$.y) aes(x = .data$.x)). ggplot usage, matrix (including simple vector) data converted long-format data frame, similar process utilized ggheatmap. note long-format data frame contain .row_panel .column_panel column, align_gg can one facet axis. case input data already data frame, three additional columns-(.row_names, .row_index, .panel)—added data frame. data underlying ggplot object contains following columns: .panel: panel current annotation .row_names .row_index: row names row index original matrix data frame. .column_names .column_index: row column index original matrix (applicable data matrix). .x .y: x y coordinates value: actual matrix value (applicable data matrix). can also use ggalign function alias align_gg.","code":"ggheatmap(small_mat) + scale_fill_viridis_c(guide = \"none\") + hmanno(\"t\") + align_dendro(aes(color = branch), k = 3) + ggalign(data = rowSums) + geom_bar(aes(y = value, fill = .panel), stat = \"identity\") + scale_fill_brewer(palette = \"Dark2\") + hmanno(\"l\") + ggalign(aes(x = value), data = rowSums) + geom_bar( aes(y = .y, fill = factor(.y)), stat = \"identity\", orientation = \"y\" ) + scale_fill_brewer(palette = \"Set1\") + scale_x_reverse()"},{"path":"https://yunuuuu.github.io/ggalign/articles/align.html","id":"session-information","dir":"Articles","previous_headings":"align_*","what":"Session information","title":"align","text":"","code":"sessionInfo() #> R version 4.4.1 (2024-06-14) #> Platform: x86_64-pc-linux-gnu #> Running under: Ubuntu 22.04.4 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.20.so; LAPACK version 3.10.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.1 ggplot2_3.5.1 #> #> loaded via a namespace (and not attached): #> [1] gtable_0.3.5 jsonlite_1.8.8 highr_0.11 dplyr_1.1.4 #> [5] compiler_4.4.1 tidyselect_1.2.1 tidyr_1.3.1 jquerylib_0.1.4 #> [9] systemfonts_1.1.0 scales_1.3.0 textshaping_0.4.0 ggh4x_0.2.8 #> [13] yaml_2.3.10 fastmap_1.2.0 R6_2.5.1 labeling_0.4.3 #> [17] generics_0.1.3 patchwork_1.2.0 knitr_1.48 tibble_3.2.1 #> [21] desc_1.4.3 munsell_0.5.1 RColorBrewer_1.1-3 bslib_0.8.0 #> [25] pillar_1.9.0 rlang_1.1.4 utf8_1.2.4 cachem_1.1.0 #> [29] xfun_0.46 fs_1.6.4 sass_0.4.9 viridisLite_0.4.2 #> [33] cli_3.6.3 pkgdown_2.1.0 withr_3.0.1 magrittr_2.0.3 #> [37] digest_0.6.36 grid_4.4.1 lifecycle_1.0.4 vctrs_0.6.5 #> [41] evaluate_0.24.0 glue_1.7.0 farver_2.1.2 ragg_1.3.2 #> [45] fansi_1.0.6 colorspace_2.1-1 rmarkdown_2.27 purrr_1.0.2 #> [49] tools_4.4.1 pkgconfig_2.0.3 htmltools_0.5.8.1"},{"path":"https://yunuuuu.github.io/ggalign/articles/layout-heatmap.html","id":"layout_heatmap","dir":"Articles","previous_headings":"","what":"layout_heatmap","title":"layout-heatmap","text":"layout_heatmap utilizes grammar graphics construct heatmap heatmap annotations. can also use alias ggheatmap.","code":"library(ggalign) #> Loading required package: ggplot2"},{"path":"https://yunuuuu.github.io/ggalign/articles/layout-heatmap.html","id":"input-data","dir":"Articles","previous_headings":"layout_heatmap","what":"Input data","title":"layout-heatmap","text":"data input can numeric character vector, data frame, data can converted matrix. Simple vector converted one column matrix.","code":"set.seed(123) small_mat <- matrix(rnorm(81), nrow = 9) rownames(small_mat) <- paste0(\"row\", seq_len(nrow(small_mat))) colnames(small_mat) <- paste0(\"column\", seq_len(ncol(small_mat))) ggheatmap(letters) ggheatmap(1:10) ggheatmap(small_mat)"},{"path":"https://yunuuuu.github.io/ggalign/articles/layout-heatmap.html","id":"heatmap-body","dir":"Articles","previous_headings":"layout_heatmap","what":"Heatmap body","title":"layout-heatmap","text":"ggplot2 usage, matrix input converted long formated data frame drawing. default mapping use aes(.data$.x, .data$.y), can controlled using mapping argument. data underlying ggplot object contains following columns: .row_panel: row panel .column_panel: column panel .row_names .column_names: row column names original matrix (applicable names exist). .row_index .column_index: row column index original matrix. .x .y: x y coordinates value: actual matrix value. filling = TRUE, following layer added automatically: set filling = FALSE, blank heamtap drawn. can treat LayerHeatmap object normal ggplot2 object default mapping data. can add ggplot2 elements usual.","code":"geom_tile( aes(.data$.x, .data$.y, fill = .data$value), width = 1L, height = 1L ) #> mapping: x = ~.data$.x, y = ~.data$.y, fill = ~.data$value #> geom_tile: linejoin = mitre, na.rm = FALSE #> stat_identity: na.rm = FALSE #> position_identity ggheatmap(small_mat, filling = FALSE) ggheatmap(small_mat) + geom_point() + scale_fill_viridis_c()"},{"path":"https://yunuuuu.github.io/ggalign/articles/layout-heatmap.html","id":"position-scales","dir":"Articles","previous_headings":"layout_heatmap > Heatmap body","what":"Position scales","title":"layout-heatmap","text":"position scales, limits setted, internal always reset default. required align heatmap annotation. breaks labels position scales handled similar manner discrete scale, thought can provide continuous scale. breaks, value one : labels one : - NULL labels can use discrete scale continuous scale, argument work . note ’s hard match discrete scale limits, sometimes, manually specify expand argument. arguments provided original scale raw matrix, internal reorder accordingly reorder heatmap rows/columns. ’ll use heatmap annotation reorder heatmap, unfamiliar adding heatmap annotations, need worry. provide comprehensive explanation following section. want learn align_* functions, try see vignette(\"align\"). hmanno indicates annotation added. example, “top” “bottom” , since align_reorder won’t add plot region. align_reorder reorder heatmap rows/columns based weights returned fun argument. reorder heatmap columns means.","code":"ggheatmap(small_mat) + scale_x_continuous(limits = c(0, 0)) - `NULL` for no breaks - `waiver()` for the default breaks (the full data index or `NULL` if no data names and `labels` is `waiver()`) - A character vector of breaks. - A numeric vector of data index. - A function that takes the data limits or the data index as input and returns breaks as output. Also accepts rlang lambda function notation. ggheatmap(small_mat) + scale_x_continuous(breaks = NULL) ggheatmap(small_mat) + scale_x_continuous() no_names <- small_mat colnames(no_names) <- NULL ggheatmap(no_names) + scale_x_continuous() ggheatmap(small_mat) + scale_x_continuous(breaks = c(\"column3\", \"column5\")) ggheatmap(small_mat) + scale_x_continuous(breaks = 5:6) - `waiver()` for the default labels (data names) - A character vector giving labels (must be same length as breaks) - An expression vector (must be the same length as breaks). See `?plotmath` for details. - A function that takes the data names (or breaks if data has no names) as input and returns labels as output. Also accepts rlang lambda function notation. ggheatmap(small_mat) + scale_x_continuous(labels = NULL) ggheatmap(small_mat) + scale_x_continuous() ggheatmap(small_mat) + scale_x_continuous(labels = letters[seq_len(ncol(small_mat))]) ggheatmap(small_mat) + scale_x_continuous(breaks = c(3, 5), labels = c(\"a\", \"b\")) ggheatmap(small_mat) + scale_x_discrete(breaks = c(3, 5), labels = c(\"a\", \"b\")) index <- order(colMeans(small_mat)) xlabels <- letters[seq_len(ncol(small_mat))] print(xlabels[index]) #> [1] \"c\" \"h\" \"i\" \"g\" \"f\" \"e\" \"a\" \"b\" \"d\" # we provide the labels in the original order, the layout will reorder them. ggheatmap(small_mat) + scale_x_continuous(labels = xlabels) + hmanno(\"t\") + align_reorder()"},{"path":"https://yunuuuu.github.io/ggalign/articles/layout-heatmap.html","id":"facets-and-panel-titles","dir":"Articles","previous_headings":"layout_heatmap > Heatmap body","what":"Facets and Panel titles","title":"layout-heatmap","text":"working facets, manual configuration panel using facet_* function possible since internal use facet_grid set row/column groups controlled heatmap annotation. However, can provide facet_grid facet_null (panel) control arguments except rows cols. common usage case change panel strip text. default theme ggalign removed panel strip text, can override behaviour theme(strip.text = element_text()). allows us add panel title appropriately heatmaps heatmap annotation plot.","code":"ggheatmap(small_mat) + facet_grid(labeller = labeller(.column_panel = function(x) letters[as.integer(x)])) + theme(strip.text = element_text()) + hmanno(\"top\") + align_kmeans(centers = 3L)"},{"path":"https://yunuuuu.github.io/ggalign/articles/layout-heatmap.html","id":"heatmap-annotations","dir":"Articles","previous_headings":"layout_heatmap","what":"Heatmap annotations","title":"layout-heatmap","text":"Heatmap annotation works adding additional information heatmap rows/columns. Heatmap annotations can positioned top, left, bottom, right heatmap. referred active context ggheatmap. can add annotation align_* functions. default, ggheatmap function initialize active context, want add heatmap annotations, need use hmanno specify annotation added.","code":""},{"path":"https://yunuuuu.github.io/ggalign/articles/layout-heatmap.html","id":"control-size","dir":"Articles","previous_headings":"layout_heatmap","what":"Control size","title":"layout-heatmap","text":"different ggplot objects combined using patchwork package. Internally, build_patchwork function used construct merge ggplot objects single patchwork object. ggheatmap width height control relative (can also provide unit object) width height heatmap body. hmanno function size argument control relative width (left right annotation) height (top bottom annotation) whole annotation. anno_* function size argument control relative width (left right annotation) height (top bottom annotation) single annotation whole annotation.","code":"ggheatmap(small_mat) + scale_fill_viridis_c() + hmanno(\"t\", size = unit(20, \"mm\")) + ggalign(data = rowSums) + geom_bar(aes(y = value, fill = .x), stat = \"identity\") + hmanno(\"l\", size = 0.2) + ggalign(aes(x = value), data = rowSums) + geom_bar( aes(y = .y, fill = factor(.y)), stat = \"identity\", orientation = \"y\" ) + scale_fill_brewer(palette = \"Set1\", guide = \"none\") + scale_x_reverse()"},{"path":"https://yunuuuu.github.io/ggalign/articles/layout-heatmap.html","id":"session-information","dir":"Articles","previous_headings":"layout_heatmap","what":"Session information","title":"layout-heatmap","text":"","code":"sessionInfo() #> R version 4.4.1 (2024-06-14) #> Platform: x86_64-pc-linux-gnu #> Running under: Ubuntu 22.04.4 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.20.so; LAPACK version 3.10.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.1 ggplot2_3.5.1 #> #> loaded via a namespace (and not attached): #> [1] gtable_0.3.5 jsonlite_1.8.8 highr_0.11 dplyr_1.1.4 #> [5] compiler_4.4.1 tidyselect_1.2.1 tidyr_1.3.1 jquerylib_0.1.4 #> [9] systemfonts_1.1.0 scales_1.3.0 textshaping_0.4.0 ggh4x_0.2.8 #> [13] yaml_2.3.10 fastmap_1.2.0 R6_2.5.1 labeling_0.4.3 #> [17] generics_0.1.3 patchwork_1.2.0 knitr_1.48 tibble_3.2.1 #> [21] desc_1.4.3 munsell_0.5.1 RColorBrewer_1.1-3 bslib_0.8.0 #> [25] pillar_1.9.0 rlang_1.1.4 utf8_1.2.4 cachem_1.1.0 #> [29] xfun_0.46 fs_1.6.4 sass_0.4.9 viridisLite_0.4.2 #> [33] cli_3.6.3 pkgdown_2.1.0 withr_3.0.1 magrittr_2.0.3 #> [37] digest_0.6.36 grid_4.4.1 lifecycle_1.0.4 vctrs_0.6.5 #> [41] evaluate_0.24.0 glue_1.7.0 farver_2.1.2 ragg_1.3.2 #> [45] fansi_1.0.6 colorspace_2.1-1 rmarkdown_2.27 purrr_1.0.2 #> [49] tools_4.4.1 pkgconfig_2.0.3 htmltools_0.5.8.1"},{"path":"https://yunuuuu.github.io/ggalign/articles/layout-stack.html","id":"layout_stack","dir":"Articles","previous_headings":"","what":"layout_stack","title":"layout-stack","text":"layout_stack put plots horizontally vertically. can also use alias ggstack.","code":"set.seed(123) mat1 <- matrix(rnorm(80, 2), 8, 10) mat1 <- rbind(mat1, matrix(rnorm(40, -2), 4, 10)) rownames(mat1) <- paste0(\"R\", 1:12) colnames(mat1) <- paste0(\"C\", 1:10) mat2 <- matrix(runif(60, max = 3, min = 1), 6, 10) mat2 <- rbind(mat2, matrix(runif(60, max = 2, min = 0), 6, 10)) rownames(mat2) <- paste0(\"R\", 1:12) colnames(mat2) <- paste0(\"C\", 1:10) le <- sample(letters[1:3], 12, replace = TRUE) names(le) <- paste0(\"R\", 1:12) ind <- sample(12, 12) mat1 <- mat1[ind, ] mat2 <- mat2[ind, ] le <- le[ind] ht1 <- ggheatmap(mat1, width = 1) + scale_fill_viridis_c() + hmanno(\"t\") + align_dendro(k = 3L) + scale_y_continuous(expand = expansion()) + hmanno(NULL) ht2 <- ggheatmap(mat2, width = 1) ggstack(mat1, sizes = c(0.2, 1, 1)) + align_dendro(size = 0.2) + scale_x_reverse() + ht1 + ht2 + active() + ggalign(data = le, size = 0.2) + geom_tile(aes(x = .column_index, fill = value)) + scale_x_continuous(name = NULL, labels = NULL, breaks = NULL) & theme(plot.margin = margin())"},{"path":"https://yunuuuu.github.io/ggalign/articles/layout-stack.html","id":"session-information","dir":"Articles","previous_headings":"layout_stack","what":"Session information","title":"layout-stack","text":"","code":"sessionInfo() #> R version 4.4.1 (2024-06-14) #> Platform: x86_64-pc-linux-gnu #> Running under: Ubuntu 22.04.4 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.20.so; LAPACK version 3.10.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.1 ggplot2_3.5.1 #> #> loaded via a namespace (and not attached): #> [1] gtable_0.3.5 jsonlite_1.8.8 highr_0.11 dplyr_1.1.4 #> [5] compiler_4.4.1 tidyselect_1.2.1 tidyr_1.3.1 jquerylib_0.1.4 #> [9] systemfonts_1.1.0 scales_1.3.0 textshaping_0.4.0 ggh4x_0.2.8 #> [13] yaml_2.3.10 fastmap_1.2.0 R6_2.5.1 labeling_0.4.3 #> [17] generics_0.1.3 patchwork_1.2.0 knitr_1.48 tibble_3.2.1 #> [21] desc_1.4.3 munsell_0.5.1 bslib_0.8.0 pillar_1.9.0 #> [25] rlang_1.1.4 utf8_1.2.4 cachem_1.1.0 xfun_0.46 #> [29] fs_1.6.4 sass_0.4.9 viridisLite_0.4.2 cli_3.6.3 #> [33] pkgdown_2.1.0 withr_3.0.1 magrittr_2.0.3 digest_0.6.36 #> [37] grid_4.4.1 lifecycle_1.0.4 vctrs_0.6.5 evaluate_0.24.0 #> [41] glue_1.7.0 farver_2.1.2 ragg_1.3.2 fansi_1.0.6 #> [45] colorspace_2.1-1 purrr_1.0.2 rmarkdown_2.27 tools_4.4.1 #> [49] pkgconfig_2.0.3 htmltools_0.5.8.1"},{"path":"https://yunuuuu.github.io/ggalign/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Yun Peng. Author, maintainer.","code":""},{"path":"https://yunuuuu.github.io/ggalign/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Peng Y (2024). ggalign: Align Multiple 'ggplot' Objects. R package version 0.0.1, https://yunuuuu.github.io/ggalign/, https://github.com/Yunuuuu/ggalign.","code":"@Manual{, title = {ggalign: Align Multiple 'ggplot' Objects}, author = {Yun Peng}, year = {2024}, note = {R package version 0.0.1, https://yunuuuu.github.io/ggalign/}, url = {https://github.com/Yunuuuu/ggalign}, }"},{"path":"https://yunuuuu.github.io/ggalign/index.html","id":"ggalign","dir":"","previous_headings":"","what":"Align Multiple ggplot Objects","title":"Align Multiple ggplot Objects","text":"package extends ggplot2 provides numerous benefits organizing arranging plots. specifically designed align specific axis multiple ggplot objects consistent order. functionality particularly useful plots require manipulation data order. common plot combination can effectively organized using package includes dendrogram heatmap.","code":""},{"path":"https://yunuuuu.github.io/ggalign/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Align Multiple ggplot Objects","text":"can install development version ggalign GitHub : package now depends un-merged features patchwork. Please see https://github.com/thomasp85/patchwork/pull/373. want try , install patchwork pak::pkg_install(Yunuuuu/patchwork@align_axis_title). documentation ggalign currently progress.","code":"# install.packages(\"remotes\") remotes::install_github(\"Yunuuuu/ggalign\")"},{"path":"https://yunuuuu.github.io/ggalign/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"Align Multiple ggplot Objects","text":"ggalign provides two layout arrange ggplot objects: layout_heatmap()/ggheamtap(): Arrange ggplot Heatmap. See vignette(\"layout-heatmap\") details. layout_stack()/ggstack(): Arrange ggplot vertically horizontally. See vignette(\"layout-stack\") details. ggalign provides Align objects reorder set panels layout: align_group(): Group layout axis panel align_kmeans(): Group layout observations kmeans align_reorder(): Reorder layout observations align_dendro(): Reorder Group layout based Hierarchical Clustering addition, Align objects can also add plot layout: align_gg()/ggalign(): Create ggplot object layout align_panel()/ggpanel(): Create ggplot object based layout panel data. See vignette(\"align\") details.","code":""},{"path":[]},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/reference/Layout-class.html","id":null,"dir":"Reference","previous_headings":"","what":"A Layout object — Layout-class","title":"A Layout object — Layout-class","text":"Layout object defines place plots.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/activate.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine the context of subsequent manipulations — activate","title":"Determine the context of subsequent manipulations — activate","text":"Determine context subsequent manipulations","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/activate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine the context of subsequent manipulations — activate","text":"","code":"activate(x, what)"},{"path":"https://yunuuuu.github.io/ggalign/reference/activate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine the context of subsequent manipulations — activate","text":"x ggheatmap object. get activated? Possible values follows: string \"top\", \"left\", \"bottom\", \"right\". NULL: means set active context heatmap .","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/activate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine the context of subsequent manipulations — activate","text":"object class x, whose active context set.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/active.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine the active context of stack layout — active","title":"Determine the active context of stack layout — active","text":"Determine active context stack layout","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/active.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine the active context of stack layout — active","text":"","code":"active( what = NULL, sizes = NULL, guides = NULL, align_axis_title = NULL, plot_data = NA )"},{"path":"https://yunuuuu.github.io/ggalign/reference/active.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine the active context of stack layout — active","text":"get activated stack layout? Possible values follows: single number string plot elements stack layout. NULL: means set active context last Align object. way, can add Align objects StackLayout. sizes numeric unit object length 3 indicates relative widths (direction = \"horizontal\") / heights (direction = \"vertical\"). guides string specifying guides treated layout. \"collect\" collect guides given nesting level, removing duplicates. \"keep stop collection level let guides placed alongside plot. \"auto\" allow guides collected upper level tries, place alongside plot . modify default guide \"position\" theme(legend.position=...) also collecting guides must apply change overall layout. align_axis_title boolean value character axis position (\"t\", \"l\", \"b\", \"r\") indicates align axis title. default, axis title aligned. plot_data function used transform plot data rendering. default, 'll inherit parent layout. parent layout, default modify data. Use NULL, want modify anything. Used modify data layout preparation applied, data handled ggplot2 rendering. Use hook needs change default data geoms.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/active.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine the active context of stack layout — active","text":"active object can added StackLayout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Align object — align","title":"Create Align object — align","text":"Align object act layout object, reorder split observations, can also add plot components layout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Align object — align","text":"","code":"align( align_class, params, size = NULL, data = NULL, plot_data = waiver(), limits = TRUE, facet = TRUE, set_context = TRUE, order = NULL, name = NULL, check.param = TRUE, call = caller_call() )"},{"path":"https://yunuuuu.github.io/ggalign/reference/align.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Align object — align","text":"size Plot size, can unit object. data matrix, data frame, even simple vector converted one-column matrix. data argument set NULL, align_* use layout data. Additionally, data argument can also accept function (purrr-like lambda also okay), applied layout data, important note align_* functions consider rows observations. means NROW(data) must return number parallel layout axis. layout_heatmap: column annotation, layout data transposed using (data function, applied transposed matrix). necessary column annotation uses heatmap columns observations, need rows. layout_stack: layout data used since place plots along single axis. plot_data function used transform plot data rendering. default, 'll inherit parent layout. parent layout, default modify data. Use NULL, want modify anything. Used modify data layout preparation applied, data handled ggplot2 rendering. Use hook needs change default data geoms. limits boolean value indicates whether set layout limtis plot. facet boolean value indicates whether set layout facet plot. FALSE, limits always FALSE . set_context single boolean value indicates whether set active context current Align object. TRUE, subsequent ggplot elements added Align object. order single integer layout order. name string object name. check.param single boolean value indicates whether check supplied parameters warn. call call used construct Align reporting messages.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Align object — align","text":"new Align object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align.html","id":"align","dir":"Reference","previous_headings":"","what":"Align","title":"Create 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 annotation. setup_data: Prepare data used annotation. compute: method used compute statistics. layout: method used group heamap rows/columns panel reorder heamtap rows/columns. draw: method used draw plot. Must return ggplot object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_dendro.html","id":null,"dir":"Reference","previous_headings":"","what":"Dendrogram plot — align_dendro","title":"Dendrogram plot — align_dendro","text":"Dendrogram plot","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_dendro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dendrogram plot — align_dendro","text":"","code":"align_dendro( mapping = aes(), ..., distance = \"euclidean\", method = \"complete\", use_missing = \"pairwise.complete.obs\", reorder_group = FALSE, k = NULL, h = NULL, plot_dendrogram = TRUE, plot_cut_height = NULL, root = NULL, center = FALSE, type = \"rectangle\", size = NULL, data = NULL, plot_data = waiver(), set_context = TRUE, order = NULL, name = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_dendro.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dendrogram plot — align_dendro","text":"mapping Additional default list aesthetic mappings use 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. 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 returns hclust object. 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_group single boolean value, indicates whether Hierarchical Clustering groups, used previous groups established. k integer scalar indicates desired number groups. h numeric scalar indicates heights tree cut. 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 branch. Otherwise (default), plot middle direct child nodes. type string indicates plot type, \"rectangle\" \"triangle\". size Plot size, can unit object. data matrix, data frame, even simple vector converted one-column matrix. data argument set NULL, align_* use layout data. Additionally, data argument can also accept function (purrr-like lambda also okay), applied layout data, important note align_* functions consider rows observations. means NROW(data) must return number parallel layout axis. layout_heatmap: column annotation, layout data transposed using (data function, applied transposed matrix). necessary column annotation uses heatmap columns observations, need rows. layout_stack: layout data used since place plots along single axis. plot_data function used transform plot data rendering. default, 'll inherit parent layout. parent layout, default modify data. Use NULL, want modify anything. Used modify data layout preparation applied, data handled ggplot2 rendering. Use hook needs change default data geoms. set_context single boolean value indicates whether set active context current Align object. TRUE, subsequent ggplot elements added Align object. order single integer layout order. name string object name.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_dendro.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dendrogram plot — align_dendro","text":"new Align object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_dendro.html","id":"ggplot-details","dir":"Reference","previous_headings":"","what":"ggplot2 details","title":"Dendrogram plot — align_dendro","text":"align_dendro initializes ggplot data mapping. internal always use default mapping aes(x = .data$x, y = .data$y). default ggplot data node coordinates, addition, geom_segment layer data tree segments edge coordinates added. node tree segments edge coordinates contains following columns: index: original index tree current node label: node label text x y: x-axis y-axis coordinates current node start node current edge. xend yend: x-axis y-axis coordinates terminal node current edge. branch: branch current node edge . can use column color different groups. panel: panel current node , split plot panel using facet_grid, column show panel current node edge . Note: nodes may fall outside panel (two panel), possible NA values column. also provide .panel column, always give right branch usage ggplot facet. .panel: See panel, often used. panel1 panel2: panel1 panel2 variables functionality panel, specifically edge data correspond nodes edge. leaf: logical value indicates whether current node leaf.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/reference/align_dendro.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dendrogram plot — align_dendro","text":"","code":"ggheatmap(matrix(rnorm(81), nrow = 9)) + hmanno(\"top\") + align_dendro() ggheatmap(matrix(rnorm(81), nrow = 9)) + hmanno(\"top\") + align_dendro(k = 3L)"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_gg.html","id":null,"dir":"Reference","previous_headings":"","what":"Create ggplot object in the layout — align_gg","title":"Create ggplot object in the layout — align_gg","text":"ggalign just alias align_gg.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_gg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create ggplot object in the layout — align_gg","text":"","code":"align_gg( data = NULL, mapping = aes(), size = NULL, plot_data = waiver(), limits = TRUE, facet = TRUE, set_context = TRUE, order = NULL, name = NULL ) ggalign( data = NULL, mapping = aes(), size = NULL, plot_data = waiver(), limits = TRUE, facet = TRUE, set_context = TRUE, order = NULL, name = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_gg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create ggplot object in the layout — align_gg","text":"data matrix, data frame, even simple vector converted one-column matrix. data argument set NULL, align_* use layout data. Additionally, data argument can also accept function (purrr-like lambda also okay), applied layout data, important note align_* functions consider rows observations. means NROW(data) must return number parallel layout axis. layout_heatmap: column annotation, layout data transposed using (data function, applied transposed matrix). necessary column annotation uses heatmap columns observations, need rows. layout_stack: layout data used since place plots along single axis. mapping Additional default list aesthetic mappings use plot. size Plot size, can unit object. plot_data function used transform plot data rendering. default, 'll inherit parent layout. parent layout, default modify data. Use NULL, want modify anything. Used modify data layout preparation applied, data handled ggplot2 rendering. Use hook needs change default data geoms. limits boolean value indicates whether set layout limtis plot. facet boolean value indicates whether set layout facet plot. FALSE, limits always FALSE . set_context single boolean value indicates whether set active context current Align object. TRUE, subsequent ggplot elements added Align object. order single integer layout order. name string object name.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_gg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create ggplot object in the layout — align_gg","text":"AlignGG object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_gg.html","id":"ggplot-details","dir":"Reference","previous_headings":"","what":"ggplot2 details","title":"Create ggplot object in the layout — align_gg","text":"align_gg initializes ggplot data mapping. internal always use default mapping aes(y = .data$.y) aes(x = .data$.x). ggplot usage, matrix (including simple vector) data converted long-format data frame, similar process utilized ggheatmap. note long-format data frame contain .xpanel .ypanel column, align_gg can one facet axis. case input data already data frame, three additional columns-(.row_names, .row_index, .panel)—added data frame. data underlying ggplot object contains following columns: .panel: panel current layout axis. .x .y: x y coordinates .row_names .row_index: row names row index original matrix data frame. .column_names .column_index: column names column index original matrix (applicable data matrix). value: actual matrix value (applicable data matrix). data inherit heatmap layout, additional column added. .extra_panel: panel layout axis vertically layout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_gg.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create ggplot object in the layout — align_gg","text":"","code":"ggheatmap(matrix(rnorm(81), nrow = 9)) + hmanno(\"top\") + ggalign() + geom_point(aes(y = value))"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_group.html","id":null,"dir":"Reference","previous_headings":"","what":"Group layout axis into panel — align_group","title":"Group layout axis into panel — align_group","text":"Group layout axis panel","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_group.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Group layout axis into panel — align_group","text":"","code":"align_group(group, set_context = FALSE, name = NULL)"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_group.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group layout axis into panel — align_group","text":"group character define groups, split axis different panel. set_context single boolean value indicates whether set active context current Align object. TRUE, subsequent ggplot elements added Align object. name string object name.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_group.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group layout axis into panel — align_group","text":"new Align object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_group.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Group layout axis into panel — align_group","text":"","code":"small_mat <- matrix(rnorm(81), nrow = 9) ggheatmap(small_mat) + hmanno(\"top\") + align_group(sample(letters[1:4], ncol(small_mat), replace = TRUE))"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_kmeans.html","id":null,"dir":"Reference","previous_headings":"","what":"Group layout observations by kmeans — align_kmeans","title":"Group layout observations by kmeans — align_kmeans","text":"Group layout observations kmeans","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_kmeans.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Group layout observations by kmeans — align_kmeans","text":"","code":"align_kmeans( centers, iter.max = 10, nstart = 1, algorithm = c(\"Hartigan-Wong\", \"Lloyd\", \"Forgy\", \"MacQueen\"), trace = FALSE, data = NULL, set_context = FALSE, name = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_kmeans.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group layout observations by kmeans — align_kmeans","text":"centers either number clusters, say \\(k\\), set initial (distinct) cluster centres. number, random set (distinct) rows x chosen initial centres. 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 matrix, data frame, even simple vector converted one-column matrix. data argument set NULL, align_* use layout data. Additionally, data argument can also accept function (purrr-like lambda also okay), applied layout data, important note align_* functions consider rows observations. means NROW(data) must return number parallel layout axis. layout_heatmap: column annotation, layout data transposed using (data function, applied transposed matrix). necessary column annotation uses heatmap columns observations, need rows. layout_stack: layout data used since place plots along single axis. set_context single boolean value indicates whether set active context current Align object. TRUE, subsequent ggplot elements added Align object. name string object name.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_kmeans.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group layout observations by kmeans — align_kmeans","text":"new Align object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_kmeans.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Group layout observations by kmeans — align_kmeans","text":"","code":"ggheatmap(matrix(rnorm(81), nrow = 9)) + hmanno(\"t\") + align_kmeans(3L)"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_panel.html","id":null,"dir":"Reference","previous_headings":"","what":"Create ggplot object in the layout panel — align_panel","title":"Create ggplot object in the layout panel — align_panel","text":"similar ggalign() function, always use layout panel data. ggpanel just alias align_panel.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_panel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create ggplot object in the layout panel — align_panel","text":"","code":"align_panel( mapping = aes(), size = NULL, plot_data = waiver(), set_context = TRUE, order = NULL, name = NULL ) ggpanel( mapping = aes(), size = NULL, plot_data = waiver(), set_context = TRUE, order = NULL, name = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_panel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create ggplot object in the layout panel — align_panel","text":"mapping Additional default list aesthetic mappings use plot. size Plot size, can unit object. plot_data function used transform plot data rendering. default, 'll inherit parent layout. parent layout, default modify data. Use NULL, want modify anything. Used modify data layout preparation applied, data handled ggplot2 rendering. Use hook needs change default data geoms. set_context single boolean value indicates whether set active context current Align object. TRUE, subsequent ggplot elements added Align object. order single integer layout order. name string object name.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_panel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create ggplot object in the layout panel — align_panel","text":"Alignpanel object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_panel.html","id":"ggplot-details","dir":"Reference","previous_headings":"","what":"ggplot2 details","title":"Create ggplot object in the layout panel — align_panel","text":"align_panel initializes ggplot data mapping. internal always use default mapping aes(y = .data$.y) aes(x = .data$.x). data underlying ggplot object contains following columns: .panel: panel current layout axis. .index: index original layout axis. .x .y: x y coordinates","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_panel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create ggplot object in the layout panel — align_panel","text":"","code":"ggheatmap(matrix(rnorm(81), nrow = 9)) + hmanno(\"top\") + ggalign() + geom_point(aes(y = value))"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_reorder.html","id":null,"dir":"Reference","previous_headings":"","what":"Reorder layout observations — align_reorder","title":"Reorder layout observations — align_reorder","text":"Reorder layout observations","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_reorder.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reorder layout observations — align_reorder","text":"","code":"align_reorder( fun = rowMeans, ..., strict = TRUE, decreasing = FALSE, data = NULL, set_context = FALSE, name = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/reference/align_reorder.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reorder layout observations — align_reorder","text":"fun summary function. take data return weights layout observations. ... Additional arguments passed fun. strict boolean value indicates whether order strict. previous groups established, strict FALSE, reorder observations group. decreasing boolean value. sort order increasing decreasing? data matrix, data frame, even simple vector converted one-column matrix. data argument set NULL, align_* use layout data. Additionally, data argument can also accept function (purrr-like lambda also okay), applied layout data, important note align_* functions consider rows observations. means NROW(data) must return number parallel layout axis. layout_heatmap: column annotation, layout data transposed using (data function, applied transposed matrix). necessary column annotation uses heatmap columns observations, need rows. layout_stack: layout data used since place plots along single axis. set_context single boolean value indicates whether set active context current Align object. TRUE, subsequent ggplot elements added Align object. name string object name.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_reorder.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reorder layout observations — align_reorder","text":"new Align object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/align_reorder.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reorder layout observations — align_reorder","text":"","code":"ggheatmap(matrix(rnorm(81), nrow = 9)) + hmanno(\"l\") + align_reorder()"},{"path":"https://yunuuuu.github.io/ggalign/reference/build_patchwork.html","id":null,"dir":"Reference","previous_headings":"","what":"Build Layout object for rendering. — build_patchwork","title":"Build Layout object for rendering. — build_patchwork","text":"Build Layout object rendering.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/build_patchwork.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build Layout object for rendering. — build_patchwork","text":"","code":"build_patchwork(layout)"},{"path":"https://yunuuuu.github.io/ggalign/reference/build_patchwork.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build Layout object for rendering. — build_patchwork","text":"layout layout_heatmap() layout_stack() object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/build_patchwork.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build Layout object for rendering. — build_patchwork","text":"patchwork object NULL plots.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/build_patchwork.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Build Layout object for rendering. — build_patchwork","text":"","code":"build_patchwork(ggheatmap(matrix(rnorm(100L), nrow = 10L)))"},{"path":"https://yunuuuu.github.io/ggalign/reference/cash-HeatmapLayout-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Subset a HeatmapLayout object — $,HeatmapLayout-method","title":"Subset a HeatmapLayout object — $,HeatmapLayout-method","text":"Used ggplot_build ggsave","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/cash-HeatmapLayout-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subset a HeatmapLayout object — $,HeatmapLayout-method","text":"","code":"# S4 method for class 'HeatmapLayout' x$name"},{"path":"https://yunuuuu.github.io/ggalign/reference/cash-HeatmapLayout-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subset a HeatmapLayout object — $,HeatmapLayout-method","text":"x HeatmapLayout object name string slot name HeatmapLayout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/cash-StackLayout-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Subset a StackLayout object — $,StackLayout-method","title":"Subset a StackLayout object — $,StackLayout-method","text":"Used ggplot_build ggsave","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/cash-StackLayout-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subset a StackLayout object — $,StackLayout-method","text":"","code":"# S4 method for class 'StackLayout' x$name"},{"path":"https://yunuuuu.github.io/ggalign/reference/cash-StackLayout-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subset a StackLayout object — $,StackLayout-method","text":"x StackLayout object name string slot name StackLayout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/dendrogram_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Dengrogram x and y coordinates — dendrogram_data","title":"Dengrogram x and y coordinates — dendrogram_data","text":"Dengrogram x y coordinates","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/dendrogram_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dengrogram x and y coordinates — dendrogram_data","text":"","code":"dendrogram_data( tree, priority = \"right\", center = FALSE, type = \"rectangle\", leaf_pos = NULL, leaf_braches = NULL, branch_gap = NULL, root = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/reference/dendrogram_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dengrogram x and y coordinates — dendrogram_data","text":"tree hclust dendrogram object. 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 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. branch_gap single numeric value indicates gap different branches. root length one string numeric indicates root branch.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/dendrogram_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dengrogram x and y coordinates — dendrogram_data","text":"list 2 data.frame. One node coordinates, another edge coordinates. node tree segments edge coordinates contains following columns: index: original index tree current node label: node label text x y: x-axis y-axis coordinates current node start node current edge. xend yend: x-axis y-axis coordinates terminal node current edge. branch: branch current node edge . can use column color different groups. panel: panel current node , split plot panel using facet_grid, column show panel current node edge . Note: nodes may fall outside panel (two panels), possible NA values column. also provide ggpanel column, always give right branch usage ggplot facet. ggpanel: See panel, often used. panel1 panel2: panel1 panel2 variables functionality panel, specifically edge data correspond nodes edge. leaf: logical value indicates whether current node leaf.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/dendrogram_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dengrogram x and y coordinates — dendrogram_data","text":"","code":"dendrogram_data(hclust(dist(USArrests), \"ave\")) #> $node #> index label x y branch leaf panel ggpanel #> 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 #> 94 NA 46.687500 27.779904 root FALSE #> 95 NA 44.718750 33.117815 root FALSE #> 96 NA 42.859375 41.094765 root FALSE #> 97 NA 38.648438 54.746831 root FALSE #> 98 NA 31.222656 89.232093 root FALSE #> #> $edge #> x xend y yend branch panel1 panel2 ggpanel #> 1 1.000000 1.000000 0.000000 38.527912 root #> 2 2.000000 2.000000 0.000000 38.527912 root #> 3 1.500000 1.000000 38.527912 38.527912 root #> 4 1.500000 2.000000 38.527912 38.527912 root