{"id":13711668,"url":"https://github.com/ShixiangWang/polar","last_synced_at":"2025-05-06T21:31:54.492Z","repository":{"id":37665436,"uuid":"426229667","full_name":"ShixiangWang/polar","owner":"ShixiangWang","description":"polar: Dots and Their Connections in Polar Coordinate System","archived":false,"fork":false,"pushed_at":"2022-10-10T10:39:10.000Z","size":1141,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-28T17:27:32.893Z","etag":null,"topics":["ggplot2-enhancements"],"latest_commit_sha":null,"homepage":"https://shixiangwang.github.io/polar/","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/ShixiangWang.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}},"created_at":"2021-11-09T12:57:54.000Z","updated_at":"2023-02-19T16:30:13.000Z","dependencies_parsed_at":"2022-08-21T06:50:42.667Z","dependency_job_id":null,"html_url":"https://github.com/ShixiangWang/polar","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShixiangWang%2Fpolar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShixiangWang%2Fpolar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShixiangWang%2Fpolar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShixiangWang%2Fpolar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShixiangWang","download_url":"https://codeload.github.com/ShixiangWang/polar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224535380,"owners_count":17327525,"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":["ggplot2-enhancements"],"created_at":"2024-08-02T23:01:10.498Z","updated_at":"2024-11-13T22:30:30.276Z","avatar_url":"https://github.com/ShixiangWang.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, 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# ggpolar: Dots and Their Connections in Polar Coordinate System\n\n[![ggpolar status badge](https://shixiangwang.r-universe.dev/badges/ggpolar)](https://shixiangwang.r-universe.dev)\n[![CRAN\nstatus](https://www.r-pkg.org/badges/version/ggpolar)](https://CRAN.R-project.org/package=ggpolar)\n[![](https://cranlogs.r-pkg.org/badges/grand-total/ggpolar?color=blue)](https://cran.r-project.org/package=ggpolar)\n\n`{ggpolar}` provides a very flexible way to create dots in coordinate system\nfor event list and connect the dots with segments based on [`{ggplot2}`](https://ggplot2.tidyverse.org/).\n\n## Installation\n\nYou can install the released version of `{ggpolar}` from CRAN with:\n\n``` r\ninstall.packages(\"ggpolar\")\n```\n\nYou can install the development version of `{ggpolar}` from GitHub with:\n\n``` r\nremotes::install_github(\"ShixiangWang/polar\")\n```\n\n## Example\n\n### Init a polar plot\n\n```{r example}\nlibrary(ggpolar)\n\ndata \u003c- data.frame(x = LETTERS[1:7])\n\np1 \u003c- polar_init(data, x = x)\np1\n\n# Set aes value\np2 \u003c- polar_init(data, x = x, size = 3, color = \"red\", alpha = 0.5)\np2\n\n# Set aes mapping\nset.seed(123L)\ndata1 \u003c- data.frame(\n  x = LETTERS[1:7],\n  shape = c(\"r\", \"r\", \"r\", \"b\", \"b\", \"b\", \"b\"),\n  color = c(\"r\", \"r\", \"r\", \"b\", \"b\", \"b\", \"b\"),\n  size = abs(rnorm(7))\n)\n# Check https://ggplot2.tidyverse.org/reference/geom_point.html\n# for how to use both stroke and color\np3 \u003c- polar_init(data1, x = x, aes(size = size, color = color, shape = shape), alpha = 0.5)\np3\n```\n\n### Connect polar dots\n\n```{r}\ndata2 \u003c- data.frame(\n  x1 = LETTERS[1:7],\n  x2 = c(\"B\", \"C\", \"D\", \"E\", \"C\", \"A\", \"C\"),\n  color = c(\"r\", \"r\", \"r\", \"b\", \"b\", \"b\", \"b\")\n)\np4 \u003c- p3 + polar_connect(data2, x1, x2)\np4\n\n# Unlike polar_init, mappings don't need to be included in aes()\np5 \u003c- p3 + polar_connect(data2, x1, x2, color = color, alpha = 0.8, linetype = 2)\np5\n\n# Use two different color scales\nif (requireNamespace(\"ggnewscale\")) {\n  library(ggnewscale)\n  p6 = p3 +\n    new_scale(\"color\") +\n    polar_connect(data2, x1, x2, color = color, alpha = 0.8, linetype = 2)\n  print(p6 + scale_color_brewer())\n  print(p6 + scale_color_manual(values = c(\"darkgreen\", \"magenta\")))\n}\n```\n\n## Citation\n\nIf you use `{ggpolar}` in academic research, please cite the following paper along\nwith the GitHub repo.\n\n*Antigen presentation and tumor immunogenicity in cancer immunotherapy response prediction*, __eLife__. https://doi.org/10.7554/eLife.49020.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShixiangWang%2Fpolar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FShixiangWang%2Fpolar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FShixiangWang%2Fpolar/lists"}