{"id":33187105,"url":"https://andrie.github.io/ggdendro/","last_synced_at":"2025-11-25T18:00:40.951Z","repository":{"id":56934086,"uuid":"2166358","full_name":"andrie/ggdendro","owner":"andrie","description":"Tools to extract dendrogram plot data for use with 'ggplot2'","archived":false,"fork":false,"pushed_at":"2025-11-19T13:10:19.000Z","size":14024,"stargazers_count":86,"open_issues_count":4,"forks_count":12,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-11-19T15:15:00.890Z","etag":null,"topics":["ggplot2","r","r-package","r-stats"],"latest_commit_sha":null,"homepage":"http://andrie.github.io/ggdendro/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrie.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-08-06T20:35:39.000Z","updated_at":"2025-11-19T13:56:50.000Z","dependencies_parsed_at":"2022-08-21T06:50:37.634Z","dependency_job_id":"ae0283af-aaf2-4c03-8b73-5b3cb3d797d5","html_url":"https://github.com/andrie/ggdendro","commit_stats":{"total_commits":132,"total_committers":4,"mean_commits":33.0,"dds":"0.16666666666666663","last_synced_commit":"b464653f6ac8d7e73acae360c605e9e80cdaf008"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/andrie/ggdendro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrie%2Fggdendro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrie%2Fggdendro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrie%2Fggdendro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrie%2Fggdendro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrie","download_url":"https://codeload.github.com/andrie/ggdendro/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrie%2Fggdendro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286079811,"owners_count":27282121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-25T02:00:05.816Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ggplot2","r","r-package","r-stats"],"created_at":"2025-11-16T05:00:30.371Z","updated_at":"2025-11-25T18:00:40.919Z","avatar_url":"https://github.com/andrie.png","language":"R","funding_links":[],"categories":["Data and models"],"sub_categories":[],"readme":"---\noutput: github_document\nformat: gfm\ndefault-image-extension: \"\"\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# ggdendro \u003cimg src='man/figures/logo.png' align=\"right\" height=\"139\" /\u003e\n\n\nProvides functions for creating dendrograms and tree plots using `ggplot2`.\n\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/ggdendro)](https://CRAN.R-project.org/package=ggdendro)\n[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/ggdendro)](http://www.r-pkg.org/pkg/ggdendro)\n[![R-CMD-check](https://github.com/andrie/ggdendro/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/andrie/ggdendro/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/andrie/ggdendro/branch/main/graph/badge.svg)](https://app.codecov.io/gh/andrie/ggdendro?branch=main)\n[![Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive)\n\u003c!-- badges: end --\u003e\n\n\n\n\nThe `ggdendro` package offers a generic function to extract data and text from the various clustering models:\n\n* `dendro_data()` extracts cluster information from the model object, e.g. cluster allocation, line segment data or label data.\n\nThe `dendro_data` object has methods for the following classes:-\n\n* `tree`\n* `hclust`\n* `dendrogram`\n* `rpart`\n\nThese methods create an object of class `dendro`, which is essentially a list of data frames.  To extract the relevant data frames from the list, use the three accessor functions:\n\n* `segment()` for the line segment data\n* `label()` for the text for each end segment\n* `leaf_label()` for the leaf labels of a tree diagram\n\n\nThe results of these functions can then be passed to `ggplot()` for plotting.\n\n## Examples\n\n```{r}\nlibrary(ggplot2)\nlibrary(ggdendro)\nhc \u003c- hclust(dist(USArrests), \"ave\")\nhcdata \u003c- dendro_data(hc, type = \"rectangle\")\nggplot() +\n  geom_segment(data = segment(hcdata), \n               aes(x = x, y = y, xend = xend, yend = yend)\n  ) +\n  geom_text(data = label(hcdata), \n            aes(x = x, y = y, label = label, hjust = 0), \n            size = 3\n  ) +\n  coord_flip() +\n  scale_y_reverse(expand = c(0.2, 0))\n\n### demonstrate plotting directly from object class hclust\nggdendrogram(hc)\nggdendrogram(hc, rotate = TRUE)\n\n### demonstrate converting hclust to dendro using dendro_data first\nhcdata \u003c- dendro_data(hc)\nggdendrogram(hcdata, rotate = TRUE) +\n  labs(title = \"Dendrogram in ggplot2\")\n```\n\t    \n# Use `dendextend` instead\n\nMost of the functionality in `ggdendro` is included in the excellent `dendextend` package.  In most cases, if you need additional functionality, please use the `dendextend` package instead.\n\nThe `ggdendro` package will only get minimal maintenance in future.\n\nRefer to \u003chttps://cran.r-project.org/web/packages/dendextend/index.html\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/andrie.github.io%2Fggdendro%2F","html_url":"https://awesome.ecosyste.ms/projects/andrie.github.io%2Fggdendro%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/andrie.github.io%2Fggdendro%2F/lists"}