{"id":13712211,"url":"https://lepennec.github.io/ggwordcloud/","last_synced_at":"2025-05-06T21:33:23.732Z","repository":{"id":56936857,"uuid":"150018515","full_name":"lepennec/ggwordcloud","owner":"lepennec","description":"A word cloud geom for ggplot2","archived":false,"fork":false,"pushed_at":"2024-06-01T09:35:36.000Z","size":13771,"stargazers_count":174,"open_issues_count":4,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-26T08:36:36.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://lepennec.github.io/ggwordcloud/","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/lepennec.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-23T19:33:25.000Z","updated_at":"2025-04-16T02:08:40.000Z","dependencies_parsed_at":"2024-06-20T21:57:32.635Z","dependency_job_id":"3ee2af89-9a36-42b3-bbae-29bf3662a9a4","html_url":"https://github.com/lepennec/ggwordcloud","commit_stats":{"total_commits":160,"total_committers":5,"mean_commits":32.0,"dds":"0.043749999999999956","last_synced_commit":"ce968d39a1a35bb5dd113b1e7f5c6ce8a7973df8"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepennec%2Fggwordcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepennec%2Fggwordcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepennec%2Fggwordcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepennec%2Fggwordcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lepennec","download_url":"https://codeload.github.com/lepennec/ggwordcloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252772418,"owners_count":21801923,"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:16.049Z","updated_at":"2025-05-06T21:33:23.152Z","avatar_url":"https://github.com/lepennec.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 setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  fig.dev = \"grDevices::png\",\n  dpi = 96L,\n  dev.args = list(),\n  fig.ext = \"png\",\n  fig.width = 700 / 96,\n  fig.height = NULL,\n  fig.retina = 2L,\n  fig.asp = 1 / 1.618,\n  fig.align = \"center\"\n)\n```\n\n# ggwordcloud \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=140/\u003e\n \n[![CRAN status](https://www.r-pkg.org/badges/version/ggwordcloud)](https://cran.r-project.org/package=ggwordcloud)\n\n`ggwordcloud` provides a word cloud text geom for `ggplot2`.  The placement algorithm implemented in C++ is an hybrid between the one of `wordcloud` and the one of `wordcloud2.js`. The cloud can grow according to a shape and stay within a mask. The size aesthetic is used either to control the font size or the printed area of the words. `ggwordcloud` also supports arbitrary text rotation. The faceting scheme of `ggplot2` can also be used. Two functions meant to be the equivalent of `wordcloud` and `wordcloud2` are proposed. Last but not least you can use `gridtext` markdown/html syntax in the labels.\n\n\n## Installation\n\nYou can install the released version of ggwordcloud from [CRAN](https://CRAN.R-project.org) with:\n```{r, eval=FALSE}\ninstall.packages(\"ggwordcloud\")\n```\nor the development version from the github repository\n```{r, eval=FALSE}\ndevtools::install_github(\"lepennec/ggwordcloud\")\n```\n\nPlease check the latest development version before submitting an issue.\n\n# Some word clouds\n\nBecause sometimes, pictures are better than a thousand words...\n\n```{r}\nlibrary(ggwordcloud)\ndata(\"love_words_small\")\nset.seed(42)\nggplot(love_words_small, aes(label = word, size = speakers)) +\n  geom_text_wordcloud() +\n  scale_size_area(max_size = 40) +\n  theme_minimal()\n```\n\n\n```{r}\ndata(\"love_words\")\nset.seed(42)\nggplot(\n  love_words,\n  aes(\n    label = word, size = speakers,\n    color = speakers\n  )\n) +\n  geom_text_wordcloud_area(aes(angle = 45 * sample(-2:2, nrow(love_words),\n    replace = TRUE,\n    prob = c(1, 1, 4, 1, 1)\n  )),\n  mask = png::readPNG(system.file(\"extdata/hearth.png\",\n    package = \"ggwordcloud\", mustWork = TRUE\n  )),\n  rm_outside = TRUE\n  ) +\n  scale_size_area(max_size = 40) +\n  theme_minimal() +\n  scale_color_gradient(low = \"darkred\", high = \"red\")\n```\n\n\n```{r}\nlibrary(dplyr, quietly = TRUE, warn.conflicts = FALSE)\nlibrary(tidyr, quietly = TRUE)\nset.seed(42)\nggplot(\n  love_words_small %\u003e%\n    gather(key = \"type\", value = \"speakers\", -lang, -word) %\u003e%\n    arrange(desc(speakers)),\n  aes(label = word, size = speakers)\n) +\n  geom_text_wordcloud_area() +\n  scale_size_area(max_size = 40) +\n  theme_minimal() +\n  facet_wrap(~type)\n```\n\n```{r}\nset.seed(42)\nggplot(love_words_small, aes(label = word, size = speakers,\n                             label_content = sprintf(\"%s\u003cspan style='font-size:7.5pt'\u003e(%g)\u003c/span\u003e\", word, speakers))) +\n  geom_text_wordcloud_area() +\n  scale_size_area(max_size = 40) +\n  theme_minimal()\n```\n\nMore examples are available in the vignette.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/lepennec.github.io%2Fggwordcloud%2F","html_url":"https://awesome.ecosyste.ms/projects/lepennec.github.io%2Fggwordcloud%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/lepennec.github.io%2Fggwordcloud%2F/lists"}