{"id":13712829,"url":"https://pabsantos.github.io/onsvplot/","last_synced_at":"2025-05-06T22:31:34.243Z","repository":{"id":181302890,"uuid":"666545790","full_name":"pabsantos/onsvplot","owner":"pabsantos","description":" National Road Safety Observatory (ONSV) Style for 'ggplot2' Graphics","archived":false,"fork":false,"pushed_at":"2023-12-11T17:09:46.000Z","size":5489,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-25T10:17:51.303Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pabsantos.github.io/onsvplot/","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/pabsantos.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","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":"2023-07-14T19:57:03.000Z","updated_at":"2023-12-11T16:36:11.000Z","dependencies_parsed_at":"2023-08-21T16:38:01.487Z","dependency_job_id":"94b4916c-0312-496e-a279-fa537edf9a0a","html_url":"https://github.com/pabsantos/onsvplot","commit_stats":null,"previous_names":["pabsantos/obsplot","pabsantos/onsvplot"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabsantos%2Fonsvplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabsantos%2Fonsvplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabsantos%2Fonsvplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabsantos%2Fonsvplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pabsantos","download_url":"https://codeload.github.com/pabsantos/onsvplot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252779099,"owners_count":21802882,"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:23.240Z","updated_at":"2025-05-06T22:31:33.409Z","avatar_url":"https://github.com/pabsantos.png","language":"R","funding_links":[],"categories":["Themes and aesthetics"],"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  fig.width = 6,\n  fig.height = 3.7,\n  dpi = 300\n)\n```\n\n# onsvplot \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"139\"/\u003e\n\n\u003c!-- badges: start --\u003e\n\n[![R-CMD-check](https://github.com/pabsantos/onsvplot/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pabsantos/onsvplot/actions/workflows/R-CMD-check.yaml)\n[![CRAN status](https://www.r-pkg.org/badges/version/onsvplot)](https://CRAN.R-project.org/package=onsvplot)\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n\u003c!-- badges: end --\u003e\n\nThe goal of `onsvplot` is to provide ggplot theme and color elements to help create graphics in the style of the [National Observatory for Road Safety](https://www.onsv.org.br/).\n\n## Overview\n\nThis package provides two main functions and a palette of colors:\n\n-   `theme_onsv()`: Apply the ONSV theme to a ggplot object;\n-   `scale_discrete_onsv()`: Apply the ONSV color palette to a ggplot object;\n-   `onsv_palette`: A data object which provides the full palette of colors, including its hex codes.\n\n## Installation\n\nYou can install the development version of `onsvplot` like so:\n\n``` r\nremotes::install_github(\"pabsantos/onsvplot\")\n```\n\nOr the CRAN version:\n\n``` r\n# install.packages(\"onsvplot\")\n```\n\n## Example\n\nThis is a basic example which shows you how to apply the functions included in this package. First, a basic ggplot graphics:\n\n```{r example-1}\nlibrary(onsvplot)\nlibrary(ggplot2)\n\nplot1 \u003c- \n  ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +\n  geom_point()\n\nplot1\n\n```\n\nThen, apply `theme_onsv()` to change the theme of the plot and `scale_discrete_onsv()` to change the colors:\n\n```{r example-2}\ntheme_set(theme_onsv())\n\nplot1 + scale_discrete_onsv()\n```\n\nIf only one color is necessary in the plot, it is possible to use one of the colors included in the `onsv_palette` object;\n\n```{r example-3}\nstr(onsv_palette)\n```\n\napplying directly to the `color` or `fill` of the `geom:`\n\n```{r example-4}\nggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width)) +\n  geom_point(color = onsv_palette$yellow)\n```\n\n## Citation\n\nIf you want to cite this package, you can cite as:\n\n```{r citation, echo=FALSE}\ncitation(\"onsvplot\")\n```\n\n\u003cimg src=\"man/figures/onsv.png\" align=\"left\" width=\"400\"/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/pabsantos.github.io%2Fonsvplot%2F","html_url":"https://awesome.ecosyste.ms/projects/pabsantos.github.io%2Fonsvplot%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/pabsantos.github.io%2Fonsvplot%2F/lists"}