{"id":13711244,"url":"https://pursuitofdatascience.github.io/ggDoubleHeat/","last_synced_at":"2025-05-06T20:32:36.284Z","repository":{"id":54476038,"uuid":"453542216","full_name":"PursuitOfDataScience/ggDoubleHeat","owner":"PursuitOfDataScience","description":"ggDoubleHeat: A heatmap-like visualization tool","archived":false,"fork":false,"pushed_at":"2023-08-24T20:47:41.000Z","size":3318,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-13T21:44:57.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pursuitofdatascience.github.io/ggDoubleHeat/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PursuitOfDataScience.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-01-29T23:20:45.000Z","updated_at":"2024-08-30T08:18:16.000Z","dependencies_parsed_at":"2024-01-17T16:56:56.429Z","dependency_job_id":"5bbcc42a-86fb-4500-ae8a-c8779aa14979","html_url":"https://github.com/PursuitOfDataScience/ggDoubleHeat","commit_stats":{"total_commits":49,"total_committers":2,"mean_commits":24.5,"dds":"0.020408163265306145","last_synced_commit":"fe2bb5c60c56f38edb20382531491b618c0600ba"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PursuitOfDataScience%2FggDoubleHeat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PursuitOfDataScience%2FggDoubleHeat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PursuitOfDataScience%2FggDoubleHeat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PursuitOfDataScience%2FggDoubleHeat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PursuitOfDataScience","download_url":"https://codeload.github.com/PursuitOfDataScience/ggDoubleHeat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252764672,"owners_count":21800732,"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","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":[],"created_at":"2024-08-02T23:01:06.134Z","updated_at":"2025-05-06T20:32:35.602Z","avatar_url":"https://github.com/PursuitOfDataScience.png","language":"R","funding_links":[],"categories":["Plot layers"],"sub_categories":[],"readme":"---\ntitle: \"ggDoubleHeat\"\noutput: github_document\n---\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/PursuitOfDataScience/ggDoubleHeat/workflows/R-CMD-check/badge.svg)](https://github.com/PursuitOfDataScience/ggDoubleHeat/actions)\n[![CRAN status](https://www.r-pkg.org/badges/version/ggDoubleHeat)](https://CRAN.R-project.org/package=ggDoubleHeat)\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n\u003c!-- badges: end --\u003e\n\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE,\n                      warning = FALSE,\n                      message = FALSE,\n                      fig.path = \"man/figures/README-\")\n```\n\n\n\nThe `ggDoubleHeat` package is a `ggplot2` extension that provides visualization for data from two different sources on a modified heat map. All functions from the package are named as `geom_heat_*()`. A regular heat map, which can be made by using `geom_tile()` from `ggplot2`, contains three dimensions (variables). `geom_heat_*()`, however, can express four dimensions of data on a single plot. \n\n\n## Installation\n\nPlease install the released version of `ggDoubleHeat` from CRAN with:\n\n``` r\ninstall.packages(\"ggDoubleHeat\")\n```\n\nAlternatively, you can install the latest development version from Github with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"PursuitOfDataScience/ggDoubleHeat\")\n```\n\n## Usage\n\nFor demonstration purposes, the built-in dataset `pitts_tg` is used to illustrate the basic usage of the package.\n\n```{r}\nlibrary(ggDoubleHeat)\nlibrary(ggplot2)\npitts_tg\n```\n\n`pitts_tg` is a dataset that collects the 30-week period of COVID-related Google \u0026 Twitter incidence rate for 9 different categories from the Pittsburgh Metropolitan Statistical Area (MSA). For the complete information of the dataset, please type `?pitts_tg` on the console. \n\nLet's start with `geom_heat_grid()`:\n\n```{r}\nggplot(data = pitts_tg, aes(x = week, y = category)) +\n  geom_heat_grid(outside = Google, inside = Twitter) +\n  ggtitle(\"Pittsburgh Google \u0026 Twitter Incidence Rate (%) Comparison\")\n```\n\nNow changing `geom_heat_grid()` to `geom_heat_circle()`:\n\n```{r}\nggplot(data = pitts_tg, aes(x = week, y = category)) +\n  geom_heat_circle(outside = Google, inside = Twitter) +\n  ggtitle(\"Pittsburgh Google \u0026 Twitter Incidence Rate (%) Comparison\")\n  \n```\n\nLet's use `geom_heat_tri()`:\n\n```{r}\nggplot(data = pitts_tg, aes(x = week, y = category)) +\n  geom_heat_tri(lower = Google, upper = Twitter) +\n  ggtitle(\"Pittsburgh Google \u0026 Twitter Incidence Rate (%) Comparison\")\n```\n\n\nTo make things a bit more colorful, the most popular emoji for a given week in a given category from the respective Pittsburgh Twitter daily sample files is rendered on each component of the heatgrid by using `ggtext`. The following code is commented, as it takes few minutes to generate. If you would like to run it, just simply uncomment the code. **But the generated heatgrid with emojis is attached below as an image**. \n\n\n```{r fig.height = 8, fig.width = 15}\n# install.packages(\"ggtext\")\n# library(ggtext)\n# \n# ggplot(data = pitts_tg, aes(x = week, y = category)) +\n#   geom_heat_grid(outside = Google, inside = Twitter) +\n#   # rendering emojis using \"richtext\"\n#   annotate(\"richtext\", x = rep(c(1:30), 9), y = rep(1:9, each = 30), \n#            label = pitts_emojis, label.color = NA, fill = NA, size = 0.3) +\n#   ggtitle(\"Pittsburgh Google \u0026 Twitter Incidence Rate (%) Comparison\")\n```\n\n\n![image](https://user-images.githubusercontent.com/54338793/153519943-24346494-11ec-41df-ba38-b17bc4272fa4.png)\n\nNote: `pitts_emojis` is the Emoji metadata built in `ggDoubleHeat`. Another thing worth noting is that there are some grids not having Emoji, and the reason is that there is no Emoji Unicode in the Twitter sample file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/pursuitofdatascience.github.io%2FggDoubleHeat%2F","html_url":"https://awesome.ecosyste.ms/projects/pursuitofdatascience.github.io%2FggDoubleHeat%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/pursuitofdatascience.github.io%2FggDoubleHeat%2F/lists"}