Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://botan.github.io/ggrounded/
Rounded Bar Plots
https://botan.github.io/ggrounded/
Last synced: 2 days ago
JSON representation
Rounded Bar Plots
- Host: GitHub
- URL: https://botan.github.io/ggrounded/
- Owner: botan
- License: other
- Created: 2023-05-01T20:31:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-11T09:43:27.000Z (over 1 year ago)
- Last Synced: 2024-10-28T17:26:50.756Z (19 days ago)
- Language: R
- Homepage: https://botan.github.io/ggrounded/
- Size: 630 KB
- Stars: 13
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
dpi = 144
)
```[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/botan/ggrounded/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/botan/ggrounded/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/botan/ggrounded/branch/main/graph/badge.svg)](https://app.codecov.io/gh/botan/ggrounded?branch=main)
[![CRAN status](https://www.r-pkg.org/badges/version/ggrounded)](https://CRAN.R-project.org/package=ggrounded)ggrounded creates bar plots with rounded corners using ggplot2.
## Installation
Install the released version of ggrounded from CRAN:
```{r, eval = FALSE}
install.packages("ggrounded")
```Or install the development version from GitHub with:
```{r, eval = FALSE}
# install.packages("pak")
pak::pak("botan/ggrounded")
```## Usage
There are two types of bar charts in ggplot2: `geom_bar()` and `geom_col()`. `geom_bar_rounded()` and `geom_col_rounded()` are wrappers on them for rounding the top corners. `geom_bar_rounded()` makes the height of the bar proportional to the number of cases in each group (or if the `weight` aesthetic is supplied, the sum of the weights).
```{r example1}
library(ggrounded)
library(ggplot2)ggplot(mpg, aes(class)) +
geom_bar_rounded()
```If you want the heights of the bars to represent values in the data, use `geom_col_rounded()` instead.
```{r example2}
ggplot(data.frame(x = letters[1:3], y = c(2.3, 1.9, 3.2)), aes(x, y)) +
geom_col_rounded()
```## Code of Conduct
Please note that the ggrounded is released with a [contributor code of conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html). By contributing in this project you agree to abide by its terms.
## License
This package is released under the MIT License.