{"id":21614403,"url":"https://github.com/sciviews/chart","last_synced_at":"2025-04-11T06:51:53.157Z","repository":{"id":57807779,"uuid":"122500904","full_name":"SciViews/chart","owner":"SciViews","description":"Unified interface to R charts","archived":false,"fork":false,"pushed_at":"2024-06-03T05:15:07.000Z","size":4651,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T04:41:45.367Z","etag":null,"topics":["plot","r","r-package","sciviews"],"latest_commit_sha":null,"homepage":"https://www.sciviews.org/chart","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/SciViews.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"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":"2018-02-22T15:58:46.000Z","updated_at":"2024-06-03T05:15:10.000Z","dependencies_parsed_at":"2024-05-27T18:41:07.053Z","dependency_job_id":null,"html_url":"https://github.com/SciViews/chart","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SciViews%2Fchart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SciViews%2Fchart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SciViews%2Fchart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SciViews%2Fchart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SciViews","download_url":"https://codeload.github.com/SciViews/chart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248358548,"owners_count":21090401,"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":["plot","r","r-package","sciviews"],"created_at":"2024-11-24T22:07:54.307Z","updated_at":"2025-04-11T06:51:53.130Z","avatar_url":"https://github.com/SciViews.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"Unified Interface (with Formula) for R Plots \u003ca href='https://www.sciviews.org/chart'\u003e\u003cimg src='man/figures/logo.png' align='right' height='139'/\u003e\u003c/a\u003e\"\noutput: github_document\n---\n\n\u003c!-- Do not edit the README.md file directly. It is generated from README.Rmd. --\u003e\n\n\u003c!-- badges: start --\u003e\n\n[![R-CMD-check](https://github.com/SciViews/chart/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/SciViews/chart/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/SciViews/chart/branch/main/graph/badge.svg)](https://app.codecov.io/gh/SciViews/chart?branch=main)\n[![CRAN status](https://www.r-pkg.org/badges/version/chart)](https://cran.r-project.org/package=chart)\n[![r-universe status](https://sciviews.r-universe.dev/badges/chart)](https://sciviews.r-universe.dev/chart)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n\n\u003c!-- badges: end --\u003e\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(collapse = TRUE, comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\", out.width = \"100%\")\nlibrary(chart)\n```\n\n\nThe {chart} package  provides an alternate formula interface to {ggplot2}, and it also homogenize plot outputs from base R plots, {lattice} and {ggplot}. If labels and/or units attributes are defined for variables in the data, they are used automatically to construct the label (with units) of the axes. See \u003chttps://www.sciviews.org/chart/\u003e for more details.\n\n## Installation\n\n{chart} is not available from CRAN yet. You should install it from the [SciViews R-Universe](https://sciviews.r-universe.dev). The {data.io} package is useful too because it manages labels and units that {chart} uses. To install those two packages and their dependencies, run the following command in R:\n\n```{r, eval=FALSE}\ninstall.packages(c('chart', 'data.io'),\n  repos = c('https://sciviews.r-universe.dev', 'https://cloud.r-project.org'))\n```\n\nYou can also install the latest development version of {chart}. Make sure you have the {remotes} R package installed:\n\n```{r, eval=FALSE}\ninstall.packages(\"remotes\")\n```\n\nUse `install_github()` to install the {chart} package from GitHub (source from **main** branch will be recompiled on your machine):\n\n```{r, eval=FALSE}\nremotes::install_github(\"SciViews/chart\")\n```\n\nR should install all required dependencies automatically, and then it should compile and install {chart}.\n\n## Further explore {chart}\n\nStarting from the `airquality` from {datasets}, we can annotate our dataset with labels and units for its variable like this:\n\n```{r}\ndata(airquality, package = \"datasets\")\nairquality \u003c- data.io::labelise(airquality, label = list(\n  Ozone = \"Ozone\", Temp = \"Temperature\", Solar.R = \"Solar radiation\",\n  Wind = \"Wind speed\"\n), units = list(\n  Ozone = \"ppb\", Temp = \"°F\", Solar.R = \"lang\", Wind = \"mph\"\n))\n```\n\nhere is a first {chart}:\n\n```{r}\nlibrary(chart)\nchart(airquality, Ozone ~ Solar.R %col=% Temp) +\n  geom_point(na.rm = TRUE)\n```\n\nYou will notice that the syntax is relatively close to {ggplot2}, except that `ggplot()` is here replaced by `chart()` and `aes(x = Solar.R, y = Ozone, col = Temp)` is replaced by a formula using `y ~ x` plus an optional series of `%\u003carg\u003e%` terms where `\u003carg\u003e` is the argument you would use in {ggplot2}'s `aes()` instruction (the `aes()` form is also accepted in `chart()`). The default style is also different and closer to a \"publication-ready\" version of the plot. Finally, labels and units we defined above in the `airquality` dataset are automatically used. Of course, you can override these labels with `labs()` if you want.\n\n`chart()` is compatible with all {ggplot2} and ggplot2 extensions. It can also be used to create {lattice} or base R plots. Several specialized plots are available through `chart()` methods and types in separate packages, such as [{modelit}](https://www.sciviews.org/modelit/) and [{exploreit}](https://www.sciviews.org/exploreit/).\n\nFor further details, see \u003chttps://www.sciviews.org/chart/\u003e. You can get further help about this package this way:\n\n``` r\nlibrary(help = \"chart\")\nhelp(\"chart-package\")\nvignette(\"chart\") # Not installed with install_github()\n```\n\n## Code of Conduct\n\nPlease note that the {chart} package is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciviews%2Fchart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsciviews%2Fchart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciviews%2Fchart/lists"}