{"id":13712194,"url":"https://liamgilbey.github.io/ggwaffle/","last_synced_at":"2025-05-06T21:33:24.291Z","repository":{"id":50747235,"uuid":"145967122","full_name":"liamgilbey/ggwaffle","owner":"liamgilbey","description":"Creating waffle charts in a ggplot friendly way","archived":false,"fork":false,"pushed_at":"2022-12-03T04:06:59.000Z","size":737,"stargazers_count":64,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-03T23:24:08.076Z","etag":null,"topics":["charts","data-visualization","ggplot2","r","waffle-charts"],"latest_commit_sha":null,"homepage":"https://liamgilbey.github.io/ggwaffle/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liamgilbey.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-24T08:48:58.000Z","updated_at":"2024-07-21T08:19:02.000Z","dependencies_parsed_at":"2023-01-23T04:30:10.451Z","dependency_job_id":null,"html_url":"https://github.com/liamgilbey/ggwaffle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamgilbey%2Fggwaffle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamgilbey%2Fggwaffle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamgilbey%2Fggwaffle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liamgilbey%2Fggwaffle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liamgilbey","download_url":"https://codeload.github.com/liamgilbey/ggwaffle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224535807,"owners_count":17327596,"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":["charts","data-visualization","ggplot2","r","waffle-charts"],"created_at":"2024-08-02T23:01:15.826Z","updated_at":"2024-11-13T22:31:20.508Z","avatar_url":"https://github.com/liamgilbey.png","language":"R","funding_links":[],"categories":["Plot layers"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\n```\n\n# ggwaffle \u003cimg src=\"man/figures/logo.png\" align=\"right\" width=250/\u003e\n\n\u003c!-- badges: start --\u003e\n[![Travis Build Status](https://travis-ci.org/liamgilbey/ggwaffle.svg?branch=master)](https://travis-ci.org/liamgilbey/ggwaffle)\n[![Codecov test coverage](https://codecov.io/gh/liamgilbey/ggwaffle/branch/master/graph/badge.svg)](https://app.codecov.io/gh/liamgilbey/ggwaffle?branch=master)\n\u003c!-- badges: end --\u003e\n\nCreate waffle charts in R in a ggplot2-friendly way.\n\n##  Acknowledgements\n\nReally all credit to [Bob Rudis](https://github.com/hrbrmstr) for the work done on the original [waffle package](https://github.com/hrbrmstr/waffle). \n\n## Description\n\nggwaffle is designed to work in a very similar way to the original [waffle package](https://github.com/hrbrmstr/waffle), while being slightly closer to the workflow of a standard ggplot graphic. Consequently, it is a little more verbose.\n\n## Installation\n\nCurrently only available through github: \n\n```r\n# install.packages(\"devtools\")\ndevtools::install_github(\"liamgilbey/ggwaffle\")\n```\n\n## Usage\n\nggwaffle heavily relies on the usage of [ggplot2](https://github.com/tidyverse/ggplot2). Much like standard ggplot graphs, waffle charts are created by adding layers to a base graphic.\nBecause of the inner mechanisms of ggplot2, some of the necessary data transformations have to be completed outside of a standard plot creation. The function `waffle_iron` has been added to help with issue.\n\nggwaffle also introduces a column mapping function, `aes_d`. At this stage I have no idea of how useful this is outside the context of the package, but it seemed a nice way to specify dynamic column renaming.\n`aes_d` is obviously coined from ggplot's `aes` function and has a very similar idea. Here we are mapping column names to feed into a function so they can be renamed for used appropriately.\n\n```{r}\nlibrary(ggwaffle)\nwaffle_data \u003c- waffle_iron(mpg, aes_d(group = class))\n\nggplot(waffle_data, aes(x, y, fill = group)) + \n  geom_waffle()\n```\n\n\nFunctions have also been included to make the default graphics more waffle-like.\n``theme_waffle`` is a ggplot theme that strips back a lot of the elements of the waffle to create a cleaner look. ``scale_fill_waffle`` returns a discrete scale to make your charts look a lot like waffles.\nUsing ``coord_equal`` is recommended to make the size of the blocks even in all dimensions.\n\n```{r, fig.width=12, fig.height=6}\nwaffle_data \u003c- waffle_iron(iris, aes_d(group = Species))\n\nggplot(waffle_data, aes(x, y, fill = group)) + \n  geom_waffle() + \n  coord_equal() + \n  scale_fill_waffle() + \n  theme_waffle()\n```\n\nThe shape of the waffle tile can also be controlled, choosing from either a regular square, or a circle tile shape.\n\n```{r, fig.width=12, fig.height=6}\nwaffle_data \u003c- waffle_iron(iris, aes_d(group = Species))\n\nggplot(waffle_data, aes(x, y, colour = group)) + \n  geom_waffle(tile_shape = 'circle', size = 12) + \n  coord_equal() + \n  scale_colour_waffle() + \n  theme_waffle()\n```\n\n\n# Icons\n\nThe best way to implement icons into waffle charts is to use Guangchuang YU's [emojifont](https://cran.r-project.org/web/packages/emojifont/vignettes/emojifont.html) package. \n\n```{r, fig.width=12, fig.height=6}\nlibrary(emojifont)  \n\nwaffle_data \u003c- waffle_iron(iris, aes_d(group = Species)) \nwaffle_data$label = fontawesome('fa-twitter')\n\nggplot(waffle_data, aes(x, y, colour = group)) + \n  geom_text(aes(label=label), family='fontawesome-webfont', size=12) +\n  coord_equal() + \n  scale_colour_waffle() + \n  theme_waffle()  \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/liamgilbey.github.io%2Fggwaffle%2F","html_url":"https://awesome.ecosyste.ms/projects/liamgilbey.github.io%2Fggwaffle%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/liamgilbey.github.io%2Fggwaffle%2F/lists"}