{"id":23673200,"url":"https://github.com/flrd/ggpointless","last_synced_at":"2025-09-02T01:32:26.619Z","repository":{"id":56933998,"uuid":"451845862","full_name":"flrd/ggpointless","owner":"flrd","description":"A Collection of Geometries, and Stats for 'ggplot2'","archived":false,"fork":false,"pushed_at":"2024-07-24T14:50:50.000Z","size":22896,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-25T21:44:22.273Z","etag":null,"topics":["data-visualization","ggplot2","r","rstats"],"latest_commit_sha":null,"homepage":"https://flrd.github.io/ggpointless/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flrd.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-01-25T11:15:10.000Z","updated_at":"2024-07-24T14:48:29.000Z","dependencies_parsed_at":"2024-01-22T08:59:16.965Z","dependency_job_id":"b8d437a8-a8ed-4918-b373-fee377c6be3c","html_url":"https://github.com/flrd/ggpointless","commit_stats":{"total_commits":199,"total_committers":2,"mean_commits":99.5,"dds":0.02010050251256279,"last_synced_commit":"02ad5e3f6936887ccf60e8a938c862f8ce0b1c78"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flrd%2Fggpointless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flrd%2Fggpointless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flrd%2Fggpointless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flrd%2Fggpointless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flrd","download_url":"https://codeload.github.com/flrd/ggpointless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231732251,"owners_count":18418178,"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":["data-visualization","ggplot2","r","rstats"],"created_at":"2024-12-29T11:51:40.685Z","updated_at":"2024-12-29T11:51:41.095Z","avatar_url":"https://github.com/flrd.png","language":"R","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  out.width = \"100%\",\n  fig.align = \"center\",\n  fig.height = 3,\n  dev = \"ragg_png\",\n  dpi = 132\n)\n\nlibrary(ggpointless)\n```\n\n# ggpointless \u003ca href=\"https://flrd.github.io/ggpointless/\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"138\" /\u003e\u003c/a\u003e\n\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/ggpointless)](https://CRAN.R-project.org/package=ggpointless)\n[![R-CMD-check](https://github.com/flrd/ggpointless/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/flrd/ggpointless/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/flrd/ggpointless/branch/main/graph/badge.svg)](https://app.codecov.io/gh/flrd/ggpointless?branch=main)\n![downloads](https://cranlogs.r-pkg.org/badges/grand-total/ggpointless))\n\u003c!-- badges: end --\u003e\n\n`ggpointless` is an extension of the [`ggplot2`](https://ggplot2.tidyverse.org/) library providing additional layers. \n\n## Installation\n\nYou can install `ggpointless` from CRAN with:\n\n```{r eval=FALSE}\ninstall.packages(\"ggpointless\")\n```\n\nTo install the development version from [GitHub](https://github.com/) use:\n\n``` {r eval=FALSE}\n# install.packages(\"devtools\")\ndevtools::install_github(\"flrd/ggpointless\")\n```\n\nOnce you have installed the package, attach it by calling:\n\n```{r}\nlibrary(ggpointless)\n```\n\n## What will you get\n\n- `geom_pointless()` -- emphasizes some observations with points\n- `geom_lexis()` --\tdraws a Lexis diagram\n- `geom_chaikin()` -- applies Chaikin's corner cutting algorithm\n- `geom_catenary()` -- draws a catenary curve\n\nSee [`vignette(\"ggpointless\")`](https://flrd.github.io/ggpointless/articles/ggpointless.html)\nfor details and examples.\n\n### geom_pointless\n`geom_pointless()` let's you highlight the first, or last observations, sample minimum and sample maximum to provide additional context. Or just some visual sugar. `geom_pointless()` behaves similar to `geom_point()` except that it has a `location` argument. You can set it to `\"first\"`, `\"last\"` (default), `\"minimum\"`, `\"maximum\"`, and `\"all\"`, where `\"all\"` is just shorthand to select `\"first\"`, `\"last\"`, `\"minimum\"` and `\"maximum\"`.\n\n```{r hello-world}\ncols \u003c- c(\"#f4ae1b\", \"#d77e7b\", \"#a84dbd\", \"#311dfc\")\ntheme_set(theme_minimal())\n\nx \u003c- seq(-pi, pi, length.out = 500)\ny \u003c- outer(x, 1:5, function(x, y) sin(x * y))\n\ndf1 \u003c- data.frame(\n  var1 = x,\n  var2 = rowSums(y)\n)\n\nggplot(df1, aes(x = var1, y = var2)) +\n  geom_line() +\n  geom_pointless(aes(color = after_stat(location)),\n    location = \"all\",\n    size = 3\n  ) +\n  scale_color_manual(values = cols)\n```\n\n### geom_lexis\n`geom_lexis()` is a combination of a segment and a point layer. Given a start value and an end value, this function draws a 45° line which indicates the duration of an event. Required are `x` and `xend` aesthetics, `y` and `yend` coordinates will be calculated.\n\n```{r geom-lexis, warning=FALSE}\ndf2 \u003c- data.frame(\n  key = c(\"A\", \"B\", \"B\", \"C\", \"D\"),\n  x = c(0, 1, 6, 5, 6),\n  xend = c(5, 4, 10, 8, 10)\n)\n\nggplot(df2, aes(x = x, xend = xend, color = key)) +\n  geom_lexis(aes(linetype = after_stat(type)), size = 2) +\n  coord_equal() +\n  scale_x_continuous(breaks = c(df2$x, df2$xend)) +\n  scale_color_manual(values = cols) +\n  scale_linetype_identity() +\n  theme(panel.grid.minor = element_blank())\n```\n\nSee also the [`LexisPlotR` package](https://github.com/ottlngr/LexisPlotR).\n\n### geom_chaikin\n\nChaikin's corner cutting algorithm let's you turn a ragged path or polygon into a smoothed one. Credit to [Farbfetzen / corner_cutting](https://github.com/Farbfetzen/corner_cutting). \n\n```{r geom-chaikin, warning=FALSE}\nlst \u003c- list(\n  data = list(\n    closed_square = data.frame(x = c(0, 0, 1, 1), y = c(2, 3, 3, 2)),\n    whale = data.frame(x = c(.5, 4, 4, 3.5, 2), y = c(.5, 1, 1.5, .5, 3)),\n    open_triangle = data.frame(x = c(3, 3, 5), y = c(2, 3, 3)),\n    closed_triangle = data.frame(x = c(3.5, 5, 5), y = c(0, 0, 1.5))\n  ),\n  color = cols,\n  closed = c(TRUE, TRUE, FALSE, TRUE)\n)\n\nggplot(mapping = aes(x, y)) +\n  lapply(lst$data, function(i) {\n    geom_polygon(data = i, fill = NA, linetype = \"12\", color = \"#777777\")\n  }) +\n  Map(f = function(data, color, closed) {\n    geom_chaikin(data = data, color = color, closed = closed)\n  }, data = lst$data, color = lst$color, closed = lst$closed) +\n  geom_point(data = data.frame(x = 1.5, y = 1.5)) +\n  coord_equal()\n```\n\nSee also the [`smoothr` package](https://github.com/mstrimas/smoothr/).\n\n### geom_catenary\n\nDraws a flexible curve that simulates a chain or rope hanging loosely between\ntwo fixed points. By default, a chain length twice the Euclidean distance\nbetween each x/y combination is used. See [`vignette(\"ggpointless\")`](https://flrd.github.io/ggpointless/articles/ggpointless.html)\nfor details.\n\nCredit to: [dulnan/catenary-curve](https://github.com/dulnan/catenary-curve)\n\n```{r geom-catenary, warning=FALSE}\nggplot(data.frame(x = 1:5, y = sample(5)),\n       aes(x, y)) + \n  geom_catenary() +\n  geom_point(size = 3, colour = \"#f4ae1b\")\n```\n\n\n## Data\n\nIn addition to the geoms \u0026 stats, the following data sets are contained in `ggpointless`:\n\n1. `co2_ml` : [CO~2~ records taken at Mauna Loa](https://gml.noaa.gov/ccgg/trends/data.html)\n2. `covid_vac` : [COVID-19 Cases and Deaths by Vaccination Status](https://covid.cdc.gov/covid-data-tracker/#rates-by-vaccine-status)\n3. `female_leaders` : [Elected and appointed female heads of state and government](https://en.wikipedia.org/w/index.php?title=List_of_elected_and_appointed_female_heads_of_state_and_government\u0026oldid=1078024588)\n\nFor more examples call [`vignette(\"examples\")`](https://flrd.github.io/ggpointless/articles/examples.html).\n\n## Code of Conduct\n\nPlease note that this project is released with a [Contributor Code of Conduct](https://github.com/flrd/ggpointless/blob/main/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflrd%2Fggpointless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflrd%2Fggpointless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflrd%2Fggpointless/lists"}