Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flying-sheep/ggplot.multistats
Multiple Summary Statistics for Binned Stats/Geometries
https://github.com/flying-sheep/ggplot.multistats
ggplot2 ggplot2-geom r statistics
Last synced: 2 months ago
JSON representation
Multiple Summary Statistics for Binned Stats/Geometries
- Host: GitHub
- URL: https://github.com/flying-sheep/ggplot.multistats
- Owner: flying-sheep
- License: gpl-3.0
- Created: 2019-05-07T18:50:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-08T06:50:19.000Z (4 months ago)
- Last Synced: 2024-10-28T17:24:00.785Z (3 months ago)
- Topics: ggplot2, ggplot2-geom, r, statistics
- Language: R
- Homepage:
- Size: 79.1 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![CRAN badge][]](https://cran.r-project.org/package=ggplot.multistats) [![Workflow badge][]](https://github.com/flying-sheep/ggplot.multistats/commits/master)
[CRAN badge]: https://www.r-pkg.org/badges/version/ggplot.multistats
[Workflow badge]: https://github.com/flying-sheep/ggplot.multistats/workflows/Build%20R%20package/badge.svgggplot.multistats
=================`ggplot.multistats` currently provides `stat_summaries_hex` and some helpers.
`stat_summaries_hex` is similar to [`ggplot2::stat_summary_hex`][stat_summary_2d],
but allows specifying multiple stats using the `funs` parameter (see [Example](#Example)).[stat_summary_2d]: https://ggplot2.tidyverse.org/reference/stat_summary_2d.html
Installation
------------
`ggplot.multistats` is on [CRAN](https://CRAN.R-project.org).```r
install.packages('ggplot.multistats')
```You can also install the development version from GitHub:
```r
# install.packages('devtools')
devtools::install_github('flying-sheep/ggplot.multistats')
```Example
-------
Specify a summary variable using the `z` aesthetic
and specify a list of `funs` to provide `after_stat`s for you:```r
library(ggplot2)
library(ggplot.multistats)ggplot(iris, aes(Sepal.Width, Sepal.Length)) +
stat_summaries_hex(
aes(z = Petal.Width, fill = after_stat(median), alpha = after_stat(n)),
funs = c('median', n = 'length'),
bins = 5
)
```![](example.png)