项目作者: flying-sheep

项目描述 :
Multiple Summary Statistics for Binned Stats/Geometries
高级语言: R
项目地址: git://github.com/flying-sheep/ggplot.multistats.git
创建时间: 2019-05-07T18:50:12Z
项目社区:https://github.com/flying-sheep/ggplot.multistats

开源协议:GNU General Public License v3.0

下载


CRAN badge Workflow badge

ggplot.multistats

ggplot.multistats currently provides stat_summaries_hex and some helpers.

stat_summaries_hex is similar to ggplot2::stat_summary_hex,
but allows specifying multiple stats using the funs parameter (see Example).

Installation

ggplot.multistats is on CRAN.

  1. install.packages('ggplot.multistats')

You can also install the development version from GitHub:

  1. # install.packages('devtools')
  2. 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_stats for you:

  1. library(ggplot2)
  2. library(ggplot.multistats)
  3. ggplot(iris, aes(Sepal.Width, Sepal.Length)) +
  4. stat_summaries_hex(
  5. aes(z = Petal.Width, fill = after_stat(median), alpha = after_stat(n)),
  6. funs = c('median', n = 'length'),
  7. bins = 5
  8. )