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: 3 months 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 (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-11T09:43:27.000Z (almost 2 years ago)
- Last Synced: 2024-10-28T17:26:50.756Z (4 months 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
)
```[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://github.com/botan/ggrounded/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/botan/ggrounded?branch=main)
[](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.