{"id":31297268,"url":"https://github.com/rivasiker/gghoriplot","last_synced_at":"2025-09-24T22:06:25.153Z","repository":{"id":54651097,"uuid":"348336919","full_name":"rivasiker/ggHoriPlot","owner":"rivasiker","description":"A user-friendly, highly customizable R package for building horizon plots in ggplot2","archived":false,"fork":false,"pushed_at":"2024-07-12T08:59:47.000Z","size":38105,"stargazers_count":145,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-18T21:36:44.966Z","etag":null,"topics":["data-science","data-visualization","ggplot2","horizon-plots","r","r-package"],"latest_commit_sha":null,"homepage":"https://rivasiker.github.io/ggHoriPlot/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rivasiker.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"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":"2021-03-16T12:21:34.000Z","updated_at":"2025-06-21T14:47:02.000Z","dependencies_parsed_at":"2024-07-12T10:25:12.893Z","dependency_job_id":null,"html_url":"https://github.com/rivasiker/ggHoriPlot","commit_stats":{"total_commits":88,"total_committers":2,"mean_commits":44.0,"dds":"0.13636363636363635","last_synced_commit":"db505ba4ada619e3d9de6c3b20e4ca911c9f1bf0"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rivasiker/ggHoriPlot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rivasiker%2FggHoriPlot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rivasiker%2FggHoriPlot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rivasiker%2FggHoriPlot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rivasiker%2FggHoriPlot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rivasiker","download_url":"https://codeload.github.com/rivasiker/ggHoriPlot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rivasiker%2FggHoriPlot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276824969,"owners_count":25711261,"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","status":"online","status_checked_at":"2025-09-24T02:00:09.776Z","response_time":97,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-science","data-visualization","ggplot2","horizon-plots","r","r-package"],"created_at":"2025-09-24T22:06:24.139Z","updated_at":"2025-09-24T22:06:25.147Z","avatar_url":"https://github.com/rivasiker.png","language":"R","readme":"---\noutput: github_document\n---\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/\"\n)\n```\n\n# ggHoriPlot: horizon plots in ggplot2 \u003cimg src='man/images/sticker_ggHoriPlot.png' align=\"right\" height=\"180\" \u003e\n\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/rivasiker/ggHoriPlot/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/rivasiker/ggHoriPlot/actions/workflows/check-standard.yaml)\n[![CRAN](https://www.r-pkg.org/badges/version/ggHoriPlot)](https://CRAN.R-project.org/package=ggHoriPlot)\n[![downloads](https://cranlogs.r-pkg.org/badges/grand-total/ggHoriPlot)](https://CRAN.R-project.org/package=ggHoriPlot)\n[![codecov](https://codecov.io/gh/rivasiker/ggHoriPlot/branch/master/graph/badge.svg?token=8V5E63YVM2)](https://app.codecov.io/gh/rivasiker/ggHoriPlot)\n\u003c!-- badges: end --\u003e\n\nThis package allows building horizon plots in ggplot2. You can learn more about the package in `vignette(\"ggHoriPlot\")`.\n\n## Installation\n\nYou can install `ggHoriPlot` from CRAN via:\n\n``` r\ninstall.packages(\"ggHoriPlot\")\n```\n\nYou can also install the development version of the package from GitHub with the following command:\n\n``` r\n#install.packages(\"devtools\")\ndevtools::install_github(\"rivasiker/ggHoriPlot\")\n```\n\n## Basic example\n\nLoad the libraries:\n\n```{r libraries, warning=FALSE, message=FALSE}\nlibrary(tidyverse)\nlibrary(ggHoriPlot) \nlibrary(ggthemes)\n\n```\n\nLoad the dataset and calculate the cutpoints and origin:\n\n```{r set}\nutils::data(climate_CPH)\n\ncutpoints \u003c- climate_CPH  %\u003e% \n  mutate(\n    outlier = between(\n      AvgTemperature, \n      quantile(AvgTemperature, 0.25, na.rm=T)-\n        1.5*IQR(AvgTemperature, na.rm=T),\n      quantile(AvgTemperature, 0.75, na.rm=T)+\n        1.5*IQR(AvgTemperature, na.rm=T))) %\u003e% \n  filter(outlier)\n\nori \u003c- sum(range(cutpoints$AvgTemperature))/2\nsca \u003c- seq(range(cutpoints$AvgTemperature)[1], \n           range(cutpoints$AvgTemperature)[2], \n           length.out = 7)[-4]\n\nround(ori, 2) # The origin\n\nround(sca, 2) # The horizon scale cutpoints\n\n```\n\nBuild the horizon plots in `ggplot2` using `geom_horizon()`:\n\n```{r CPH_climate}\nclimate_CPH %\u003e% ggplot() +\n  geom_horizon(aes(date_mine, \n                   AvgTemperature,\n                   fill = ..Cutpoints..), \n               origin = ori, horizonscale = sca) +\n  scale_fill_hcl(palette = 'RdBu', reverse = T) +\n  facet_grid(Year~.) +\n  theme_few() +\n  theme(\n    panel.spacing.y=unit(0, \"lines\"),\n    strip.text.y = element_text(size = 7, angle = 0, hjust = 0),\n    axis.text.y = element_blank(),\n    axis.title.y = element_blank(),\n    axis.ticks.y = element_blank(),\n    panel.border = element_blank()\n    ) +\n  scale_x_date(expand=c(0,0), \n               date_breaks = \"1 month\", \n               date_labels = \"%b\") +\n  xlab('Date') +\n  ggtitle('Average daily temperature in Copenhagen', \n          'from 1995 to 2019')\n\n```\n\n## Learn more\n\nYou can check out the full functionality of `ggHoriPlot` in the following guides:\n\n  - [Getting started](https://rivasiker.github.io/ggHoriPlot/articles/ggHoriPlot.html)\n  - [Examples with real data](https://rivasiker.github.io/ggHoriPlot/articles/examples.html)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frivasiker%2Fgghoriplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frivasiker%2Fgghoriplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frivasiker%2Fgghoriplot/lists"}