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 @@ -Create ggplot object in the layout panel — align_panel • ggalignCreate ggplot object with layout panel data — align_panel • ggalign Skip to contents @@ -44,7 +44,7 @@
diff --git a/reference/index.html b/reference/index.html index e1b62fe7..19a5b318 100644 --- a/reference/index.html +++ b/reference/index.html @@ -154,7 +154,7 @@

Plot basicsalign_panel() ggpanel() -
Create ggplot object in the layout panel
+
Create ggplot object with layout panel data

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 #> 5 5.000000 5.000000 0.000000 13.896043 root #> 6 6.000000 6.000000 0.000000 13.896043 root #> 7 5.500000 5.000000 13.896043 13.896043 root #> 8 5.500000 6.000000 13.896043 13.896043 root #> 9 4.000000 4.000000 0.000000 15.453120 root #> 10 5.500000 5.500000 13.896043 15.453120 root #> 11 4.750000 4.000000 15.453120 15.453120 root #> 12 4.750000 5.500000 15.453120 15.453120 root #> 13 3.000000 3.000000 0.000000 28.012211 root #> 14 4.750000 4.750000 15.453120 28.012211 root #> 15 3.875000 3.000000 28.012211 28.012211 root #> 16 3.875000 4.750000 28.012211 28.012211 root #> 17 8.000000 8.000000 0.000000 15.454449 root #> 18 9.000000 9.000000 0.000000 15.454449 root #> 19 8.500000 8.000000 15.454449 15.454449 root #> 20 8.500000 9.000000 15.454449 15.454449 root #> 21 7.000000 7.000000 0.000000 16.891499 root #> 22 8.500000 8.500000 15.454449 16.891499 root #> 23 7.750000 7.000000 16.891499 16.891499 root #> 24 7.750000 8.500000 16.891499 16.891499 root #> 25 10.000000 10.000000 0.000000 6.236986 root #> 26 11.000000 11.000000 0.000000 6.236986 root #> 27 10.500000 10.000000 6.236986 6.236986 root #> 28 10.500000 11.000000 6.236986 6.236986 root #> 29 12.000000 12.000000 0.000000 13.297368 root #> 30 13.000000 13.000000 0.000000 13.297368 root #> 31 12.500000 12.000000 13.297368 13.297368 root #> 32 12.500000 13.000000 13.297368 13.297368 root #> 33 10.500000 10.500000 6.236986 18.417331 root #> 34 12.500000 12.500000 13.297368 18.417331 root #> 35 11.500000 10.500000 18.417331 18.417331 root #> 36 11.500000 12.500000 18.417331 18.417331 root #> 37 7.750000 7.750000 16.891499 26.363428 root #> 38 11.500000 11.500000 18.417331 26.363428 root #> 39 9.625000 7.750000 26.363428 26.363428 root #> 40 9.625000 11.500000 26.363428 26.363428 root #> 41 15.000000 15.000000 0.000000 21.167192 root #> 42 16.000000 16.000000 0.000000 21.167192 root #> 43 15.500000 15.000000 21.167192 21.167192 root #> 44 15.500000 16.000000 21.167192 21.167192 root #> 45 14.000000 14.000000 0.000000 28.095803 root #> 46 15.500000 15.500000 21.167192 28.095803 root #> 47 14.750000 14.000000 28.095803 28.095803 root #> 48 14.750000 15.500000 28.095803 28.095803 root #> 49 9.625000 9.625000 26.363428 39.394633 root #> 50 14.750000 14.750000 28.095803 39.394633 root #> 51 12.187500 9.625000 39.394633 39.394633 root #> 52 12.187500 14.750000 39.394633 39.394633 root #> 53 3.875000 3.875000 28.012211 44.283922 root #> 54 12.187500 12.187500 39.394633 44.283922 root #> 55 8.031250 3.875000 44.283922 44.283922 root #> 56 8.031250 12.187500 44.283922 44.283922 root #> 57 1.500000 1.500000 38.527912 77.605024 root #> 58 8.031250 8.031250 44.283922 77.605024 root #> 59 4.765625 1.500000 77.605024 77.605024 root #> 60 4.765625 8.031250 77.605024 77.605024 root #> 61 20.000000 20.000000 0.000000 7.355270 root #> 62 21.000000 21.000000 0.000000 7.355270 root #> 63 20.500000 20.000000 7.355270 7.355270 root #> 64 20.500000 21.000000 7.355270 7.355270 root #> 65 19.000000 19.000000 0.000000 10.736739 root #> 66 20.500000 20.500000 7.355270 10.736739 root #> 67 19.750000 19.000000 10.736739 10.736739 root #> 68 19.750000 20.500000 10.736739 10.736739 root #> 69 18.000000 18.000000 0.000000 12.878100 root #> 70 19.750000 19.750000 10.736739 12.878100 root #> 71 18.875000 18.000000 12.878100 12.878100 root #> 72 18.875000 19.750000 12.878100 12.878100 root #> 73 17.000000 17.000000 0.000000 16.425489 root #> 74 18.875000 18.875000 12.878100 16.425489 root #> 75 17.937500 17.000000 16.425489 16.425489 root #> 76 17.937500 18.875000 16.425489 16.425489 root #> 77 23.000000 23.000000 0.000000 11.456439 root #> 78 24.000000 24.000000 0.000000 11.456439 root #> 79 23.500000 23.000000 11.456439 11.456439 root #> 80 23.500000 24.000000 11.456439 11.456439 root #> 81 22.000000 22.000000 0.000000 22.595978 root #> 82 23.500000 23.500000 11.456439 22.595978 root #> 83 22.750000 22.000000 22.595978 22.595978 root #> 84 22.750000 23.500000 22.595978 22.595978 root #> 85 17.937500 17.937500 16.425489 26.713777 root #> 86 22.750000 22.750000 22.595978 26.713777 root #> 87 20.343750 17.937500 26.713777 26.713777 root #> 88 20.343750 22.750000 26.713777 26.713777 root #> 89 26.000000 26.000000 0.000000 12.614278 root #> 90 27.000000 27.000000 0.000000 12.614278 root #> 91 26.500000 26.000000 12.614278 12.614278 root #> 92 26.500000 27.000000 12.614278 12.614278 root #> 93 25.000000 25.000000 0.000000 20.198479 root #> 94 26.500000 26.500000 12.614278 20.198479 root #> 95 25.750000 25.000000 20.198479 20.198479 root #> 96 25.750000 26.500000 20.198479 20.198479 root #> 97 29.000000 29.000000 0.000000 14.501034 root #> 98 30.000000 30.000000 0.000000 14.501034 root #> 99 29.500000 29.000000 14.501034 14.501034 root #> 100 29.500000 30.000000 14.501034 14.501034 root #> 101 28.000000 28.000000 0.000000 23.972143 root #> 102 29.500000 29.500000 14.501034 23.972143 root #> 103 28.750000 28.000000 23.972143 23.972143 root #> 104 28.750000 29.500000 23.972143 23.972143 root #> 105 25.750000 25.750000 20.198479 29.054195 root #> 106 28.750000 28.750000 23.972143 29.054195 root #> 107 27.250000 25.750000 29.054195 29.054195 root #> 108 27.250000 28.750000 29.054195 29.054195 root #> 109 20.343750 20.343750 26.713777 44.837933 root #> 110 27.250000 27.250000 29.054195 44.837933 root #> 111 23.796875 20.343750 44.837933 44.837933 root #> 112 23.796875 27.250000 44.837933 44.837933 root #> 113 33.000000 33.000000 0.000000 3.834058 root #> 114 34.000000 34.000000 0.000000 3.834058 root #> 115 33.500000 33.000000 3.834058 3.834058 root #> 116 33.500000 34.000000 3.834058 3.834058 root #> 117 32.000000 32.000000 0.000000 12.438692 root #> 118 33.500000 33.500000 3.834058 12.438692 root #> 119 32.750000 32.000000 12.438692 12.438692 root #> 120 32.750000 33.500000 12.438692 12.438692 root #> 121 31.000000 31.000000 0.000000 15.026107 root #> 122 32.750000 32.750000 12.438692 15.026107 root #> 123 31.875000 31.000000 15.026107 15.026107 root #> 124 31.875000 32.750000 15.026107 15.026107 root #> 125 35.000000 35.000000 0.000000 6.637771 root #> 126 36.000000 36.000000 0.000000 6.637771 root #> 127 35.500000 35.000000 6.637771 6.637771 root #> 128 35.500000 36.000000 6.637771 6.637771 root #> 129 37.000000 37.000000 0.000000 3.929377 root #> 130 38.000000 38.000000 0.000000 3.929377 root #> 131 37.500000 37.000000 3.929377 3.929377 root #> 132 37.500000 38.000000 3.929377 3.929377 root #> 133 39.000000 39.000000 0.000000 8.027453 root #> 134 40.000000 40.000000 0.000000 8.027453 root #> 135 39.500000 39.000000 8.027453 8.027453 root #> 136 39.500000 40.000000 8.027453 8.027453 root #> 137 37.500000 37.500000 3.929377 13.352260 root #> 138 39.500000 39.500000 8.027453 13.352260 root #> 139 38.500000 37.500000 13.352260 13.352260 root #> 140 38.500000 39.500000 13.352260 13.352260 root #> 141 35.500000 35.500000 6.637771 15.122897 root #> 142 38.500000 38.500000 13.352260 15.122897 root #> 143 37.000000 35.500000 15.122897 15.122897 root #> 144 37.000000 38.500000 15.122897 15.122897 root #> 145 31.875000 31.875000 15.026107 20.598507 root #> 146 37.000000 37.000000 15.122897 20.598507 root #> 147 34.437500 31.875000 20.598507 20.598507 root #> 148 34.437500 37.000000 20.598507 20.598507 root #> 149 43.000000 43.000000 0.000000 8.537564 root #> 150 44.000000 44.000000 0.000000 8.537564 root #> 151 43.500000 43.000000 8.537564 8.537564 root #> 152 43.500000 44.000000 8.537564 8.537564 root #> 153 42.000000 42.000000 0.000000 10.771175 root #> 154 43.500000 43.500000 8.537564 10.771175 root #> 155 42.750000 42.000000 10.771175 10.771175 root #> 156 42.750000 43.500000 10.771175 10.771175 root #> 157 45.000000 45.000000 0.000000 13.044922 root #> 158 46.000000 46.000000 0.000000 13.044922 root #> 159 45.500000 45.000000 13.044922 13.044922 root #> 160 45.500000 46.000000 13.044922 13.044922 root #> 161 49.000000 49.000000 0.000000 2.291288 root #> 162 50.000000 50.000000 0.000000 2.291288 root #> 163 49.500000 49.000000 2.291288 2.291288 root #> 164 49.500000 50.000000 2.291288 2.291288 root #> 165 48.000000 48.000000 0.000000 10.184218 root #> 166 49.500000 49.500000 2.291288 10.184218 root #> 167 48.750000 48.000000 10.184218 10.184218 root #> 168 48.750000 49.500000 10.184218 10.184218 root #> 169 47.000000 47.000000 0.000000 18.993398 root #> 170 48.750000 48.750000 10.184218 18.993398 root #> 171 47.875000 47.000000 18.993398 18.993398 root #> 172 47.875000 48.750000 18.993398 18.993398 root #> 173 45.500000 45.500000 13.044922 27.779904 root #> 174 47.875000 47.875000 18.993398 27.779904 root #> 175 46.687500 45.500000 27.779904 27.779904 root #> 176 46.687500 47.875000 27.779904 27.779904 root #> 177 42.750000 42.750000 10.771175 33.117815 root #> 178 46.687500 46.687500 27.779904 33.117815 root #> 179 44.718750 42.750000 33.117815 33.117815 root #> 180 44.718750 46.687500 33.117815 33.117815 root #> 181 41.000000 41.000000 0.000000 41.094765 root #> 182 44.718750 44.718750 33.117815 41.094765 root #> 183 42.859375 41.000000 41.094765 41.094765 root #> 184 42.859375 44.718750 41.094765 41.094765 root #> 185 34.437500 34.437500 20.598507 54.746831 root #> 186 42.859375 42.859375 41.094765 54.746831 root #> 187 38.648438 34.437500 54.746831 54.746831 root #> 188 38.648438 42.859375 54.746831 54.746831 root #> 189 23.796875 23.796875 44.837933 89.232093 root #> 190 38.648438 38.648438 54.746831 89.232093 root #> 191 31.222656 23.796875 89.232093 89.232093 root #> 192 31.222656 38.648438 89.232093 89.232093 root #> 193 4.765625 4.765625 77.605024 152.313999 root #> 194 31.222656 31.222656 89.232093 152.313999 root #> 195 17.994141 4.765625 152.313999 152.313999 root #> 196 17.994141 31.222656 152.313999 152.313999 root #>"},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":null,"dir":"Reference","previous_headings":"","what":"Layer with Grid or Function — geom_draw","title":"Layer with Grid or Function — geom_draw","text":"Draw ggplot2 layer grod function.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Layer with Grid or Function — geom_draw","text":"","code":"geom_draw( draw = grid::nullGrob(), ..., mapping = NULL, data = NULL, stat = \"identity\", position = \"identity\", na.rm = FALSE, inherit.aes = TRUE )"},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Layer with Grid or Function — geom_draw","text":"draw Either grob object function (can purrr-style) accepts two arguments (data coords) returns grob. draw function, used draw_group function Geom ggproto object. ... Additional arguments passed draw. mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer. using geom_*() function construct layer, stat argument can used override default coupling geoms stats. stat argument accepts following: Stat ggproto subclass, example StatCount. string naming stat. give stat string, strip function name stat_ prefix. example, use stat_count(), give stat \"count\". information ways specify stat, see layer stat documentation. position position adjustment use data layer. can used various ways, including prevent overplotting improving display. position argument accepts following: result calling position function, position_jitter(). method allows passing extra arguments position. string naming position adjustment. give position string, strip function name position_ prefix. example, use position_jitter(), give position \"jitter\". information ways specify position, see layer position documentation. na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Layer with Grid or Function — geom_draw","text":"ggplot2 layer.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Layer with Grid or Function — geom_draw","text":"want combine functionality multiple geoms can usually achieved preparing data geoms inside draw_*() call send different geoms, collecting output grid::gList (list grobs) call draw_group() grid::gTree (grob containing multiple children grobs) call draw_panel().","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Layer with Grid or Function — geom_draw","text":"","code":"ggdraw_text <- grid::textGrob( \"ggdraw\", x = c(0, 0, 0.5, 1, 1), y = c(0, 1, 0.5, 0, 1), hjust = c(0, 0, 0.5, 1, 1), vjust = c(0, 1, 0.5, 0, 1) ) ggplot2::ggplot(data.frame(x = 1, y = 2)) + geom_draw(ggdraw_text)"},{"path":"https://yunuuuu.github.io/ggalign/reference/ggalign-package.html","id":null,"dir":"Reference","previous_headings":"","what":"ggalign: Align Multiple 'ggplot' Objects — ggalign-package","title":"ggalign: Align Multiple 'ggplot' Objects — ggalign-package","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":[]},{"path":"https://yunuuuu.github.io/ggalign/reference/ggalign-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"ggalign: Align Multiple 'ggplot' Objects — ggalign-package","text":"Maintainer: Yun Peng yunyunp96@163.com (ORCID)","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/ggplot2-ggproto.html","id":null,"dir":"Reference","previous_headings":"","what":"Base ggproto classes for ggplot2 — GeomDraw","title":"Base ggproto classes for ggplot2 — GeomDraw","text":"Base ggproto classes ggplot2","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/ggplot2-ggproto.html","id":"geoms","dir":"Reference","previous_headings":"","what":"Geoms","title":"Base ggproto classes for ggplot2 — GeomDraw","text":"geom_*() functions (like geom_point()) return layer contains Geom* object (like GeomPoint). Geom* object responsible rendering data plot. Geom* objects ggproto() object, descended top-level Geom, implements various methods fields. Compared Stat Position, Geom little different execution setup compute functions split . setup_data runs position adjustments, draw_layer() run render time, much later. create new type Geom object, typically want override one following: Either draw_panel(self, data, panel_params, coord) draw_group(self, data, panel_params, coord). draw_panel called per panel, draw_group called per group. Use draw_panel row data represents single element. Use draw_group group represents element (e.g. smooth, violin). data data frame scaled aesthetics. panel_params set per-panel parameters coord. Generally, consider panel_params opaque data structure pass along whenever call coord method. must always call coord$transform(data, panel_params) get (position) scaled data plotting. work non-linear coordinate systems, typically need convert primitive geom (e.g. point, path polygon), pass corresponding draw method munching. Must return grob. Use zeroGrob() nothing draw. draw_key: Renders single legend key. required_aes: character vector aesthetics needed render geom. default_aes: list (generated aes() default values aesthetics. setup_data: Converts width height xmin xmax, ymin ymax values. can potentially set values well. See also new geoms section online ggplot2 book.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/ggplot2-ggproto.html","id":"coordinate-systems","dir":"Reference","previous_headings":"","what":"Coordinate systems","title":"Base ggproto classes for ggplot2 — GeomDraw","text":"coord_*() functions (like coord_trans()) return Coord* object (like CoordTrans). Coord* objects ggproto() object, descended top-level Coord. create new type Coord object, typically want implement one following: aspect: Returns desired aspect ratio plot. labels: Returns list containing labels x y. render_fg: Renders foreground elements. render_bg: Renders background elements. render_axis_h: Renders horizontal axes. render_axis_v: Renders vertical axes. backtransform_range(panel_params): Extracts panel range provided panel_params (created setup_panel_params(), see ) back-transforms data coordinates. back-transformation can needed coords coord_trans() range transformed coordinates differs range untransformed coordinates. Returns list two ranges, x y, correspond variables mapped x y aesthetics, even coords coord_flip() x aesthetic shown along y direction vice versa. range(panel_params): Extracts panel range provided panel_params (created setup_panel_params(), see ) returns . Unlike backtransform_range(), function perform back-transformation instead returns final transformed coordinates. Returns list two ranges, x y, correspond variables mapped x y aesthetics, even coords coord_flip() x aesthetic shown along y direction vice versa. transform: Transforms x y coordinates. distance: Calculates distance. is_linear: Returns TRUE coordinate system linear; FALSE otherwise. is_free: Returns TRUE coordinate system supports free positional scales; FALSE otherwise. setup_panel_params(scale_x, scale_y, params): Determines appropriate x y ranges panel, also calculates anything else needed render panel axes, tick positions labels major minor ticks. Returns information named list. setup_data(data, params): Allows coordinate system manipulate plot data. return list data frames. setup_layout(layout, params): Allows coordinate system manipulate layout data frame assigns data panels scales. See also new coords section online ggplot2 book.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/reference/hclust2.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Tree Structures with Hierarchical Clustering — hclust2","title":"Generate Tree Structures with Hierarchical Clustering — hclust2","text":"Generate Tree Structures Hierarchical Clustering","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/hclust2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Tree Structures with Hierarchical Clustering — hclust2","text":"","code":"hclust2( matrix, distance = \"euclidean\", method = \"complete\", use_missing = \"pairwise.complete.obs\" )"},{"path":"https://yunuuuu.github.io/ggalign/reference/hclust2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Tree Structures with Hierarchical Clustering — hclust2","text":"matrix numeric matrix, data frame. 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.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/hclust2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Tree Structures with Hierarchical Clustering — hclust2","text":"hclust object.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/reference/hclust2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Tree Structures with Hierarchical Clustering — hclust2","text":"","code":"hclust(dist(USArrests), \"ave\") #> #> Call: #> hclust(d = dist(USArrests), method = \"ave\") #> #> Cluster method : average #> Distance : euclidean #> Number of objects: 50 #>"},{"path":"https://yunuuuu.github.io/ggalign/reference/hmanno.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine the active context of heatmap layout — hmanno","title":"Determine the active context of heatmap layout — hmanno","text":"Determine active context heatmap layout","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/hmanno.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine the active context of heatmap layout — hmanno","text":"","code":"hmanno( position = NULL, size = NULL, what = waiver(), width = NULL, height = NULL, guides = NULL, align_axis_title = NULL, plot_data = NA )"},{"path":"https://yunuuuu.github.io/ggalign/reference/hmanno.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine the active context of heatmap layout — hmanno","text":"position heatmap annotation get activated? Possible values follows: string \"top\", \"left\", \"bottom\", \"right\". NULL: means set active context heatmap . size unit object set total size heatmap annotation. used string \"top\", \"left\", \"bottom\", \"right\". position \"top\" \"bottom\", size set total height annotation, otherwise. position \"left\" \"right\", size set total width annotation. 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. width, height Heatmap body width/height, can unit object. 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/hmanno.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine the active context of heatmap layout — hmanno","text":"active object can added HeatmapLayout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggheatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Reports whether x is a HeatmapLayout object — is.ggheatmap","title":"Reports whether x is a HeatmapLayout object — is.ggheatmap","text":"Reports whether x HeatmapLayout object","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggheatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reports whether x is a HeatmapLayout object — is.ggheatmap","text":"","code":"is.ggheatmap(x)"},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggheatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reports whether x is a HeatmapLayout object — is.ggheatmap","text":"x object test","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggheatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reports whether x is a HeatmapLayout object — is.ggheatmap","text":"boolean value","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggheatmap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reports whether x is a HeatmapLayout object — is.ggheatmap","text":"","code":"is.ggheatmap(ggheatmap(1:10)) #> [1] TRUE"},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggstack.html","id":null,"dir":"Reference","previous_headings":"","what":"Reports whether x is a StackLayout object — is.ggstack","title":"Reports whether x is a StackLayout object — is.ggstack","text":"Reports whether x StackLayout object","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggstack.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reports whether x is a StackLayout object — is.ggstack","text":"","code":"is.ggstack(x)"},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggstack.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reports whether x is a StackLayout object — is.ggstack","text":"x object test","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggstack.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reports whether x is a StackLayout object — is.ggstack","text":"boolean value","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggstack.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reports whether x is a StackLayout object — is.ggstack","text":"","code":"is.ggstack(ggstack(1:10)) #> [1] TRUE"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-add.html","id":null,"dir":"Reference","previous_headings":"","what":"Add components to Layout — layout-add","title":"Add components to Layout — layout-add","text":"Add components Layout","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-add.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add components to Layout — layout-add","text":"","code":"# S4 method for class 'Layout,ANY' e1 + e2"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-add.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add components to Layout — layout-add","text":"e1 layout_heatmap() layout_stack() object. e2 object added plot, including gg elements align object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-add.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add components to Layout — layout-add","text":"modified Layout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-add.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add components to Layout — layout-add","text":"","code":"ggheatmap(matrix(rnorm(81), nrow = 9)) + hmanno(\"t\") + ggalign() + geom_point(aes(y = value))"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-and.html","id":null,"dir":"Reference","previous_headings":"","what":"Add components to all plots — layout-and","title":"Add components to all plots — layout-and","text":"Add components plots","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-and.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add components to all plots — layout-and","text":"","code":"# S4 method for class 'Layout,ANY' e1 & e2"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-and.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add components to all plots — layout-and","text":"e1 layout_heatmap() layout_stack() object. e2 object added plot.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-and.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add components to all plots — layout-and","text":"modified Layout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_heatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Put plots around a Heatmap — layout_heatmap","title":"Put plots around a Heatmap — layout_heatmap","text":"ggheatmap alias layout_heatmap.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_heatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Put plots around a Heatmap — layout_heatmap","text":"","code":"layout_heatmap( data = NULL, mapping = aes(), width = NULL, height = NULL, guides = NULL, align_axis_title = NULL, plot_data = waiver(), filling = TRUE, ..., set_context = TRUE, order = NULL, name = NULL ) ggheatmap( data = NULL, mapping = aes(), width = NULL, height = NULL, guides = NULL, align_axis_title = NULL, plot_data = waiver(), filling = TRUE, ..., set_context = TRUE, order = NULL, name = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_heatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Put plots around a Heatmap — layout_heatmap","text":"data numeric character vector, data frame, data can converted matrix. Simple vector converted one column matrix. mapping Default list aesthetic mappings use plot. NULL, using aes(.data$.x, .data$.y). width, height Heatmap body width/height, can unit object. 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. filling boolean value indicates whether fill heatmap. want custom filling style, can set FALSE. ... Additional arguments passed geom_tile. used filling = TRUE. 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/layout_heatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Put plots around a Heatmap — layout_heatmap","text":"HeatmapLayout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_heatmap.html","id":"ggplot-details","dir":"Reference","previous_headings":"","what":"ggplot2 details","title":"Put plots around a Heatmap — layout_heatmap","text":"data input ggheatmap converted long formated data frame drawing. default mapping use aes(.data$.x, .data$.y), can use mapping argument control . data underlying ggplot object contains following columns: .xpanel .ypanel: column row panel .x .y: x y coordinates .row_names .column_names: row column names original matrix (applicable names exist). .row_index .column_index: row column index original matrix. value: actual matrix value.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_heatmap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Put plots around a Heatmap — layout_heatmap","text":"","code":"ggheatmap(1:10) ggheatmap(letters)"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_stack.html","id":null,"dir":"Reference","previous_headings":"","what":"Put plots horizontally or vertically — layout_stack","title":"Put plots horizontally or vertically — layout_stack","text":"ggstack alias layout_stack.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_stack.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Put plots horizontally or vertically — layout_stack","text":"","code":"layout_stack( data = NULL, direction = NULL, sizes = NULL, guides = NULL, align_axis_title = NULL, plot_data = waiver() ) ggstack( data = NULL, direction = NULL, sizes = NULL, guides = NULL, align_axis_title = NULL, plot_data = waiver() )"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_stack.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Put plots horizontally or vertically — layout_stack","text":"data numeric character vector, data frame, matrix. direction string \"horizontal\" \"vertical\", indicates direction stack layout. 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/layout_stack.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Put plots horizontally or vertically — layout_stack","text":"StackLayout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. grid gpar, unit","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/show-Layout-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Print Layout object — show,Layout-method","title":"Print Layout object — show,Layout-method","text":"Print Layout object","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/show-Layout-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print Layout object — show,Layout-method","text":"","code":"# S4 method for class 'Layout' show(object)"},{"path":"https://yunuuuu.github.io/ggalign/reference/show-Layout-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print Layout object — show,Layout-method","text":"object layout_heatmap() layout_stack() object.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/news/index.html","id":"features-0-0-1","dir":"Changelog","previous_headings":"","what":"Features","title":"ggalign 0.0.1","text":"Heatmap layout: Arrange ggplot Heatmap. Stack layout: Arrange ggplot vertically horizontally. 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 align_gg()/ggalign: Create ggplot object layout align_panel()/ggalign: Create ggplot object based layout panel data.","code":""}] +[{"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 with layout panel data — align_panel","title":"Create ggplot object with layout panel data — 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 with layout panel data — 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 with layout panel data — 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 with layout panel data — 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 with layout panel data — 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 with layout panel data — 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 #> 5 5.000000 5.000000 0.000000 13.896043 root #> 6 6.000000 6.000000 0.000000 13.896043 root #> 7 5.500000 5.000000 13.896043 13.896043 root #> 8 5.500000 6.000000 13.896043 13.896043 root #> 9 4.000000 4.000000 0.000000 15.453120 root #> 10 5.500000 5.500000 13.896043 15.453120 root #> 11 4.750000 4.000000 15.453120 15.453120 root #> 12 4.750000 5.500000 15.453120 15.453120 root #> 13 3.000000 3.000000 0.000000 28.012211 root #> 14 4.750000 4.750000 15.453120 28.012211 root #> 15 3.875000 3.000000 28.012211 28.012211 root #> 16 3.875000 4.750000 28.012211 28.012211 root #> 17 8.000000 8.000000 0.000000 15.454449 root #> 18 9.000000 9.000000 0.000000 15.454449 root #> 19 8.500000 8.000000 15.454449 15.454449 root #> 20 8.500000 9.000000 15.454449 15.454449 root #> 21 7.000000 7.000000 0.000000 16.891499 root #> 22 8.500000 8.500000 15.454449 16.891499 root #> 23 7.750000 7.000000 16.891499 16.891499 root #> 24 7.750000 8.500000 16.891499 16.891499 root #> 25 10.000000 10.000000 0.000000 6.236986 root #> 26 11.000000 11.000000 0.000000 6.236986 root #> 27 10.500000 10.000000 6.236986 6.236986 root #> 28 10.500000 11.000000 6.236986 6.236986 root #> 29 12.000000 12.000000 0.000000 13.297368 root #> 30 13.000000 13.000000 0.000000 13.297368 root #> 31 12.500000 12.000000 13.297368 13.297368 root #> 32 12.500000 13.000000 13.297368 13.297368 root #> 33 10.500000 10.500000 6.236986 18.417331 root #> 34 12.500000 12.500000 13.297368 18.417331 root #> 35 11.500000 10.500000 18.417331 18.417331 root #> 36 11.500000 12.500000 18.417331 18.417331 root #> 37 7.750000 7.750000 16.891499 26.363428 root #> 38 11.500000 11.500000 18.417331 26.363428 root #> 39 9.625000 7.750000 26.363428 26.363428 root #> 40 9.625000 11.500000 26.363428 26.363428 root #> 41 15.000000 15.000000 0.000000 21.167192 root #> 42 16.000000 16.000000 0.000000 21.167192 root #> 43 15.500000 15.000000 21.167192 21.167192 root #> 44 15.500000 16.000000 21.167192 21.167192 root #> 45 14.000000 14.000000 0.000000 28.095803 root #> 46 15.500000 15.500000 21.167192 28.095803 root #> 47 14.750000 14.000000 28.095803 28.095803 root #> 48 14.750000 15.500000 28.095803 28.095803 root #> 49 9.625000 9.625000 26.363428 39.394633 root #> 50 14.750000 14.750000 28.095803 39.394633 root #> 51 12.187500 9.625000 39.394633 39.394633 root #> 52 12.187500 14.750000 39.394633 39.394633 root #> 53 3.875000 3.875000 28.012211 44.283922 root #> 54 12.187500 12.187500 39.394633 44.283922 root #> 55 8.031250 3.875000 44.283922 44.283922 root #> 56 8.031250 12.187500 44.283922 44.283922 root #> 57 1.500000 1.500000 38.527912 77.605024 root #> 58 8.031250 8.031250 44.283922 77.605024 root #> 59 4.765625 1.500000 77.605024 77.605024 root #> 60 4.765625 8.031250 77.605024 77.605024 root #> 61 20.000000 20.000000 0.000000 7.355270 root #> 62 21.000000 21.000000 0.000000 7.355270 root #> 63 20.500000 20.000000 7.355270 7.355270 root #> 64 20.500000 21.000000 7.355270 7.355270 root #> 65 19.000000 19.000000 0.000000 10.736739 root #> 66 20.500000 20.500000 7.355270 10.736739 root #> 67 19.750000 19.000000 10.736739 10.736739 root #> 68 19.750000 20.500000 10.736739 10.736739 root #> 69 18.000000 18.000000 0.000000 12.878100 root #> 70 19.750000 19.750000 10.736739 12.878100 root #> 71 18.875000 18.000000 12.878100 12.878100 root #> 72 18.875000 19.750000 12.878100 12.878100 root #> 73 17.000000 17.000000 0.000000 16.425489 root #> 74 18.875000 18.875000 12.878100 16.425489 root #> 75 17.937500 17.000000 16.425489 16.425489 root #> 76 17.937500 18.875000 16.425489 16.425489 root #> 77 23.000000 23.000000 0.000000 11.456439 root #> 78 24.000000 24.000000 0.000000 11.456439 root #> 79 23.500000 23.000000 11.456439 11.456439 root #> 80 23.500000 24.000000 11.456439 11.456439 root #> 81 22.000000 22.000000 0.000000 22.595978 root #> 82 23.500000 23.500000 11.456439 22.595978 root #> 83 22.750000 22.000000 22.595978 22.595978 root #> 84 22.750000 23.500000 22.595978 22.595978 root #> 85 17.937500 17.937500 16.425489 26.713777 root #> 86 22.750000 22.750000 22.595978 26.713777 root #> 87 20.343750 17.937500 26.713777 26.713777 root #> 88 20.343750 22.750000 26.713777 26.713777 root #> 89 26.000000 26.000000 0.000000 12.614278 root #> 90 27.000000 27.000000 0.000000 12.614278 root #> 91 26.500000 26.000000 12.614278 12.614278 root #> 92 26.500000 27.000000 12.614278 12.614278 root #> 93 25.000000 25.000000 0.000000 20.198479 root #> 94 26.500000 26.500000 12.614278 20.198479 root #> 95 25.750000 25.000000 20.198479 20.198479 root #> 96 25.750000 26.500000 20.198479 20.198479 root #> 97 29.000000 29.000000 0.000000 14.501034 root #> 98 30.000000 30.000000 0.000000 14.501034 root #> 99 29.500000 29.000000 14.501034 14.501034 root #> 100 29.500000 30.000000 14.501034 14.501034 root #> 101 28.000000 28.000000 0.000000 23.972143 root #> 102 29.500000 29.500000 14.501034 23.972143 root #> 103 28.750000 28.000000 23.972143 23.972143 root #> 104 28.750000 29.500000 23.972143 23.972143 root #> 105 25.750000 25.750000 20.198479 29.054195 root #> 106 28.750000 28.750000 23.972143 29.054195 root #> 107 27.250000 25.750000 29.054195 29.054195 root #> 108 27.250000 28.750000 29.054195 29.054195 root #> 109 20.343750 20.343750 26.713777 44.837933 root #> 110 27.250000 27.250000 29.054195 44.837933 root #> 111 23.796875 20.343750 44.837933 44.837933 root #> 112 23.796875 27.250000 44.837933 44.837933 root #> 113 33.000000 33.000000 0.000000 3.834058 root #> 114 34.000000 34.000000 0.000000 3.834058 root #> 115 33.500000 33.000000 3.834058 3.834058 root #> 116 33.500000 34.000000 3.834058 3.834058 root #> 117 32.000000 32.000000 0.000000 12.438692 root #> 118 33.500000 33.500000 3.834058 12.438692 root #> 119 32.750000 32.000000 12.438692 12.438692 root #> 120 32.750000 33.500000 12.438692 12.438692 root #> 121 31.000000 31.000000 0.000000 15.026107 root #> 122 32.750000 32.750000 12.438692 15.026107 root #> 123 31.875000 31.000000 15.026107 15.026107 root #> 124 31.875000 32.750000 15.026107 15.026107 root #> 125 35.000000 35.000000 0.000000 6.637771 root #> 126 36.000000 36.000000 0.000000 6.637771 root #> 127 35.500000 35.000000 6.637771 6.637771 root #> 128 35.500000 36.000000 6.637771 6.637771 root #> 129 37.000000 37.000000 0.000000 3.929377 root #> 130 38.000000 38.000000 0.000000 3.929377 root #> 131 37.500000 37.000000 3.929377 3.929377 root #> 132 37.500000 38.000000 3.929377 3.929377 root #> 133 39.000000 39.000000 0.000000 8.027453 root #> 134 40.000000 40.000000 0.000000 8.027453 root #> 135 39.500000 39.000000 8.027453 8.027453 root #> 136 39.500000 40.000000 8.027453 8.027453 root #> 137 37.500000 37.500000 3.929377 13.352260 root #> 138 39.500000 39.500000 8.027453 13.352260 root #> 139 38.500000 37.500000 13.352260 13.352260 root #> 140 38.500000 39.500000 13.352260 13.352260 root #> 141 35.500000 35.500000 6.637771 15.122897 root #> 142 38.500000 38.500000 13.352260 15.122897 root #> 143 37.000000 35.500000 15.122897 15.122897 root #> 144 37.000000 38.500000 15.122897 15.122897 root #> 145 31.875000 31.875000 15.026107 20.598507 root #> 146 37.000000 37.000000 15.122897 20.598507 root #> 147 34.437500 31.875000 20.598507 20.598507 root #> 148 34.437500 37.000000 20.598507 20.598507 root #> 149 43.000000 43.000000 0.000000 8.537564 root #> 150 44.000000 44.000000 0.000000 8.537564 root #> 151 43.500000 43.000000 8.537564 8.537564 root #> 152 43.500000 44.000000 8.537564 8.537564 root #> 153 42.000000 42.000000 0.000000 10.771175 root #> 154 43.500000 43.500000 8.537564 10.771175 root #> 155 42.750000 42.000000 10.771175 10.771175 root #> 156 42.750000 43.500000 10.771175 10.771175 root #> 157 45.000000 45.000000 0.000000 13.044922 root #> 158 46.000000 46.000000 0.000000 13.044922 root #> 159 45.500000 45.000000 13.044922 13.044922 root #> 160 45.500000 46.000000 13.044922 13.044922 root #> 161 49.000000 49.000000 0.000000 2.291288 root #> 162 50.000000 50.000000 0.000000 2.291288 root #> 163 49.500000 49.000000 2.291288 2.291288 root #> 164 49.500000 50.000000 2.291288 2.291288 root #> 165 48.000000 48.000000 0.000000 10.184218 root #> 166 49.500000 49.500000 2.291288 10.184218 root #> 167 48.750000 48.000000 10.184218 10.184218 root #> 168 48.750000 49.500000 10.184218 10.184218 root #> 169 47.000000 47.000000 0.000000 18.993398 root #> 170 48.750000 48.750000 10.184218 18.993398 root #> 171 47.875000 47.000000 18.993398 18.993398 root #> 172 47.875000 48.750000 18.993398 18.993398 root #> 173 45.500000 45.500000 13.044922 27.779904 root #> 174 47.875000 47.875000 18.993398 27.779904 root #> 175 46.687500 45.500000 27.779904 27.779904 root #> 176 46.687500 47.875000 27.779904 27.779904 root #> 177 42.750000 42.750000 10.771175 33.117815 root #> 178 46.687500 46.687500 27.779904 33.117815 root #> 179 44.718750 42.750000 33.117815 33.117815 root #> 180 44.718750 46.687500 33.117815 33.117815 root #> 181 41.000000 41.000000 0.000000 41.094765 root #> 182 44.718750 44.718750 33.117815 41.094765 root #> 183 42.859375 41.000000 41.094765 41.094765 root #> 184 42.859375 44.718750 41.094765 41.094765 root #> 185 34.437500 34.437500 20.598507 54.746831 root #> 186 42.859375 42.859375 41.094765 54.746831 root #> 187 38.648438 34.437500 54.746831 54.746831 root #> 188 38.648438 42.859375 54.746831 54.746831 root #> 189 23.796875 23.796875 44.837933 89.232093 root #> 190 38.648438 38.648438 54.746831 89.232093 root #> 191 31.222656 23.796875 89.232093 89.232093 root #> 192 31.222656 38.648438 89.232093 89.232093 root #> 193 4.765625 4.765625 77.605024 152.313999 root #> 194 31.222656 31.222656 89.232093 152.313999 root #> 195 17.994141 4.765625 152.313999 152.313999 root #> 196 17.994141 31.222656 152.313999 152.313999 root #>"},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":null,"dir":"Reference","previous_headings":"","what":"Layer with Grid or Function — geom_draw","title":"Layer with Grid or Function — geom_draw","text":"Draw ggplot2 layer grod function.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Layer with Grid or Function — geom_draw","text":"","code":"geom_draw( draw = grid::nullGrob(), ..., mapping = NULL, data = NULL, stat = \"identity\", position = \"identity\", na.rm = FALSE, inherit.aes = TRUE )"},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Layer with Grid or Function — geom_draw","text":"draw Either grob object function (can purrr-style) accepts two arguments (data coords) returns grob. draw function, used draw_group function Geom ggproto object. ... Additional arguments passed draw. mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer. using geom_*() function construct layer, stat argument can used override default coupling geoms stats. stat argument accepts following: Stat ggproto subclass, example StatCount. string naming stat. give stat string, strip function name stat_ prefix. example, use stat_count(), give stat \"count\". information ways specify stat, see layer stat documentation. position position adjustment use data layer. can used various ways, including prevent overplotting improving display. position argument accepts following: result calling position function, position_jitter(). method allows passing extra arguments position. string naming position adjustment. give position string, strip function name position_ prefix. example, use position_jitter(), give position \"jitter\". information ways specify position, see layer position documentation. na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Layer with Grid or Function — geom_draw","text":"ggplot2 layer.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Layer with Grid or Function — geom_draw","text":"want combine functionality multiple geoms can usually achieved preparing data geoms inside draw_*() call send different geoms, collecting output grid::gList (list grobs) call draw_group() grid::gTree (grob containing multiple children grobs) call draw_panel().","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/reference/geom_draw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Layer with Grid or Function — geom_draw","text":"","code":"ggdraw_text <- grid::textGrob( \"ggdraw\", x = c(0, 0, 0.5, 1, 1), y = c(0, 1, 0.5, 0, 1), hjust = c(0, 0, 0.5, 1, 1), vjust = c(0, 1, 0.5, 0, 1) ) ggplot2::ggplot(data.frame(x = 1, y = 2)) + geom_draw(ggdraw_text)"},{"path":"https://yunuuuu.github.io/ggalign/reference/ggalign-package.html","id":null,"dir":"Reference","previous_headings":"","what":"ggalign: Align Multiple 'ggplot' Objects — ggalign-package","title":"ggalign: Align Multiple 'ggplot' Objects — ggalign-package","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":[]},{"path":"https://yunuuuu.github.io/ggalign/reference/ggalign-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"ggalign: Align Multiple 'ggplot' Objects — ggalign-package","text":"Maintainer: Yun Peng yunyunp96@163.com (ORCID)","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/ggplot2-ggproto.html","id":null,"dir":"Reference","previous_headings":"","what":"Base ggproto classes for ggplot2 — GeomDraw","title":"Base ggproto classes for ggplot2 — GeomDraw","text":"Base ggproto classes ggplot2","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/ggplot2-ggproto.html","id":"geoms","dir":"Reference","previous_headings":"","what":"Geoms","title":"Base ggproto classes for ggplot2 — GeomDraw","text":"geom_*() functions (like geom_point()) return layer contains Geom* object (like GeomPoint). Geom* object responsible rendering data plot. Geom* objects ggproto() object, descended top-level Geom, implements various methods fields. Compared Stat Position, Geom little different execution setup compute functions split . setup_data runs position adjustments, draw_layer() run render time, much later. create new type Geom object, typically want override one following: Either draw_panel(self, data, panel_params, coord) draw_group(self, data, panel_params, coord). draw_panel called per panel, draw_group called per group. Use draw_panel row data represents single element. Use draw_group group represents element (e.g. smooth, violin). data data frame scaled aesthetics. panel_params set per-panel parameters coord. Generally, consider panel_params opaque data structure pass along whenever call coord method. must always call coord$transform(data, panel_params) get (position) scaled data plotting. work non-linear coordinate systems, typically need convert primitive geom (e.g. point, path polygon), pass corresponding draw method munching. Must return grob. Use zeroGrob() nothing draw. draw_key: Renders single legend key. required_aes: character vector aesthetics needed render geom. default_aes: list (generated aes() default values aesthetics. setup_data: Converts width height xmin xmax, ymin ymax values. can potentially set values well. See also new geoms section online ggplot2 book.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/ggplot2-ggproto.html","id":"coordinate-systems","dir":"Reference","previous_headings":"","what":"Coordinate systems","title":"Base ggproto classes for ggplot2 — GeomDraw","text":"coord_*() functions (like coord_trans()) return Coord* object (like CoordTrans). Coord* objects ggproto() object, descended top-level Coord. create new type Coord object, typically want implement one following: aspect: Returns desired aspect ratio plot. labels: Returns list containing labels x y. render_fg: Renders foreground elements. render_bg: Renders background elements. render_axis_h: Renders horizontal axes. render_axis_v: Renders vertical axes. backtransform_range(panel_params): Extracts panel range provided panel_params (created setup_panel_params(), see ) back-transforms data coordinates. back-transformation can needed coords coord_trans() range transformed coordinates differs range untransformed coordinates. Returns list two ranges, x y, correspond variables mapped x y aesthetics, even coords coord_flip() x aesthetic shown along y direction vice versa. range(panel_params): Extracts panel range provided panel_params (created setup_panel_params(), see ) returns . Unlike backtransform_range(), function perform back-transformation instead returns final transformed coordinates. Returns list two ranges, x y, correspond variables mapped x y aesthetics, even coords coord_flip() x aesthetic shown along y direction vice versa. transform: Transforms x y coordinates. distance: Calculates distance. is_linear: Returns TRUE coordinate system linear; FALSE otherwise. is_free: Returns TRUE coordinate system supports free positional scales; FALSE otherwise. setup_panel_params(scale_x, scale_y, params): Determines appropriate x y ranges panel, also calculates anything else needed render panel axes, tick positions labels major minor ticks. Returns information named list. setup_data(data, params): Allows coordinate system manipulate plot data. return list data frames. setup_layout(layout, params): Allows coordinate system manipulate layout data frame assigns data panels scales. See also new coords section online ggplot2 book.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/reference/hclust2.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Tree Structures with Hierarchical Clustering — hclust2","title":"Generate Tree Structures with Hierarchical Clustering — hclust2","text":"Generate Tree Structures Hierarchical Clustering","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/hclust2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Tree Structures with Hierarchical Clustering — hclust2","text":"","code":"hclust2( matrix, distance = \"euclidean\", method = \"complete\", use_missing = \"pairwise.complete.obs\" )"},{"path":"https://yunuuuu.github.io/ggalign/reference/hclust2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Tree Structures with Hierarchical Clustering — hclust2","text":"matrix numeric matrix, data frame. 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.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/hclust2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Tree Structures with Hierarchical Clustering — hclust2","text":"hclust object.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/reference/hclust2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Tree Structures with Hierarchical Clustering — hclust2","text":"","code":"hclust(dist(USArrests), \"ave\") #> #> Call: #> hclust(d = dist(USArrests), method = \"ave\") #> #> Cluster method : average #> Distance : euclidean #> Number of objects: 50 #>"},{"path":"https://yunuuuu.github.io/ggalign/reference/hmanno.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine the active context of heatmap layout — hmanno","title":"Determine the active context of heatmap layout — hmanno","text":"Determine active context heatmap layout","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/hmanno.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine the active context of heatmap layout — hmanno","text":"","code":"hmanno( position = NULL, size = NULL, what = waiver(), width = NULL, height = NULL, guides = NULL, align_axis_title = NULL, plot_data = NA )"},{"path":"https://yunuuuu.github.io/ggalign/reference/hmanno.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine the active context of heatmap layout — hmanno","text":"position heatmap annotation get activated? Possible values follows: string \"top\", \"left\", \"bottom\", \"right\". NULL: means set active context heatmap . size unit object set total size heatmap annotation. used string \"top\", \"left\", \"bottom\", \"right\". position \"top\" \"bottom\", size set total height annotation, otherwise. position \"left\" \"right\", size set total width annotation. 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. width, height Heatmap body width/height, can unit object. 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/hmanno.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine the active context of heatmap layout — hmanno","text":"active object can added HeatmapLayout.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggheatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Reports whether x is a HeatmapLayout object — is.ggheatmap","title":"Reports whether x is a HeatmapLayout object — is.ggheatmap","text":"Reports whether x HeatmapLayout object","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggheatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reports whether x is a HeatmapLayout object — is.ggheatmap","text":"","code":"is.ggheatmap(x)"},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggheatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reports whether x is a HeatmapLayout object — is.ggheatmap","text":"x object test","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggheatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reports whether x is a HeatmapLayout object — is.ggheatmap","text":"boolean value","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggheatmap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reports whether x is a HeatmapLayout object — is.ggheatmap","text":"","code":"is.ggheatmap(ggheatmap(1:10)) #> [1] TRUE"},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggstack.html","id":null,"dir":"Reference","previous_headings":"","what":"Reports whether x is a StackLayout object — is.ggstack","title":"Reports whether x is a StackLayout object — is.ggstack","text":"Reports whether x StackLayout object","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggstack.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reports whether x is a StackLayout object — is.ggstack","text":"","code":"is.ggstack(x)"},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggstack.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reports whether x is a StackLayout object — is.ggstack","text":"x object test","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggstack.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reports whether x is a StackLayout object — is.ggstack","text":"boolean value","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/is.ggstack.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reports whether x is a StackLayout object — is.ggstack","text":"","code":"is.ggstack(ggstack(1:10)) #> [1] TRUE"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-add.html","id":null,"dir":"Reference","previous_headings":"","what":"Add components to Layout — layout-add","title":"Add components to Layout — layout-add","text":"Add components Layout","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-add.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add components to Layout — layout-add","text":"","code":"# S4 method for class 'Layout,ANY' e1 + e2"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-add.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add components to Layout — layout-add","text":"e1 layout_heatmap() layout_stack() object. e2 object added plot, including gg elements align object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-add.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add components to Layout — layout-add","text":"modified Layout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-add.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add components to Layout — layout-add","text":"","code":"ggheatmap(matrix(rnorm(81), nrow = 9)) + hmanno(\"t\") + ggalign() + geom_point(aes(y = value))"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-and.html","id":null,"dir":"Reference","previous_headings":"","what":"Add components to all plots — layout-and","title":"Add components to all plots — layout-and","text":"Add components plots","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-and.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add components to all plots — layout-and","text":"","code":"# S4 method for class 'Layout,ANY' e1 & e2"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-and.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add components to all plots — layout-and","text":"e1 layout_heatmap() layout_stack() object. e2 object added plot.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout-and.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add components to all plots — layout-and","text":"modified Layout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_heatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Put plots around a Heatmap — layout_heatmap","title":"Put plots around a Heatmap — layout_heatmap","text":"ggheatmap alias layout_heatmap.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_heatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Put plots around a Heatmap — layout_heatmap","text":"","code":"layout_heatmap( data = NULL, mapping = aes(), width = NULL, height = NULL, guides = NULL, align_axis_title = NULL, plot_data = waiver(), filling = TRUE, ..., set_context = TRUE, order = NULL, name = NULL ) ggheatmap( data = NULL, mapping = aes(), width = NULL, height = NULL, guides = NULL, align_axis_title = NULL, plot_data = waiver(), filling = TRUE, ..., set_context = TRUE, order = NULL, name = NULL )"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_heatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Put plots around a Heatmap — layout_heatmap","text":"data numeric character vector, data frame, data can converted matrix. Simple vector converted one column matrix. mapping Default list aesthetic mappings use plot. NULL, using aes(.data$.x, .data$.y). width, height Heatmap body width/height, can unit object. 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. filling boolean value indicates whether fill heatmap. want custom filling style, can set FALSE. ... Additional arguments passed geom_tile. used filling = TRUE. 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/layout_heatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Put plots around a Heatmap — layout_heatmap","text":"HeatmapLayout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_heatmap.html","id":"ggplot-details","dir":"Reference","previous_headings":"","what":"ggplot2 details","title":"Put plots around a Heatmap — layout_heatmap","text":"data input ggheatmap converted long formated data frame drawing. default mapping use aes(.data$.x, .data$.y), can use mapping argument control . data underlying ggplot object contains following columns: .xpanel .ypanel: column row panel .x .y: x y coordinates .row_names .column_names: row column names original matrix (applicable names exist). .row_index .column_index: row column index original matrix. value: actual matrix value.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_heatmap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Put plots around a Heatmap — layout_heatmap","text":"","code":"ggheatmap(1:10) ggheatmap(letters)"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_stack.html","id":null,"dir":"Reference","previous_headings":"","what":"Put plots horizontally or vertically — layout_stack","title":"Put plots horizontally or vertically — layout_stack","text":"ggstack alias layout_stack.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_stack.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Put plots horizontally or vertically — layout_stack","text":"","code":"layout_stack( data = NULL, direction = NULL, sizes = NULL, guides = NULL, align_axis_title = NULL, plot_data = waiver() ) ggstack( data = NULL, direction = NULL, sizes = NULL, guides = NULL, align_axis_title = NULL, plot_data = waiver() )"},{"path":"https://yunuuuu.github.io/ggalign/reference/layout_stack.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Put plots horizontally or vertically — layout_stack","text":"data numeric character vector, data frame, matrix. direction string \"horizontal\" \"vertical\", indicates direction stack layout. 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/layout_stack.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Put plots horizontally or vertically — layout_stack","text":"StackLayout object.","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. grid gpar, unit","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/show-Layout-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Print Layout object — show,Layout-method","title":"Print Layout object — show,Layout-method","text":"Print Layout object","code":""},{"path":"https://yunuuuu.github.io/ggalign/reference/show-Layout-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print Layout object — show,Layout-method","text":"","code":"# S4 method for class 'Layout' show(object)"},{"path":"https://yunuuuu.github.io/ggalign/reference/show-Layout-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print Layout object — show,Layout-method","text":"object layout_heatmap() layout_stack() object.","code":""},{"path":[]},{"path":"https://yunuuuu.github.io/ggalign/news/index.html","id":"features-0-0-1","dir":"Changelog","previous_headings":"","what":"Features","title":"ggalign 0.0.1","text":"Heatmap layout: Arrange ggplot Heatmap. Stack layout: Arrange ggplot vertically horizontally. 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 align_gg()/ggalign: Create ggplot object layout align_panel()/ggalign: Create ggplot object based layout panel data.","code":""}]