New Upstream Snapshot - r-cran-ggplot.multistats
Ready changes
Summary
Merged new upstream version: 1.0.1 (was: 1.0.0).
Resulting package
Built on 2023-01-19T22:58 (took 32m1s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-snapshots r-cran-ggplot.multistats
Lintian Result
Diff
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..b5b0e43
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,6 @@
+repos:
+- repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.4.0
+ hooks:
+ - id: trailing-whitespace
+ - id: end-of-file-fixer
diff --git a/DESCRIPTION b/DESCRIPTION
index 394b268..6442650 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: ggplot.multistats
Title: Multiple Summary Statistics for Binned Stats/Geometries
-Version: 1.0.0
+Version: 1.0.1
Authors@R:
person(given = "Philipp",
family = "Angerer",
@@ -16,12 +16,9 @@ URL: https://github.com/flying-sheep/ggplot.multistats
BugReports: https://github.com/flying-sheep/ggplot.multistats/issues
License: GPL-3
Encoding: UTF-8
-LazyData: true
-Imports: methods, rlang, scales, hexbin, ggplot2
-RoxygenNote: 6.1.1
+Imports: methods, rlang, scales, hexbin, ggplot2 (>= 3.3.0)
+RoxygenNote: 7.2.3
NeedsCompilation: no
-Packaged: 2019-10-22 15:28:56 UTC; angerer
+Packaged: 2023-01-19 22:46:43 UTC; root
Author: Philipp Angerer [aut, cre] (<https://orcid.org/0000-0002-0369-2888>)
Maintainer: Philipp Angerer <phil.angerer@gmail.com>
-Repository: CRAN
-Date/Publication: 2019-10-28 13:50:05 UTC
diff --git a/MD5 b/MD5
deleted file mode 100644
index 5f120c8..0000000
--- a/MD5
+++ /dev/null
@@ -1,9 +0,0 @@
-47916f97485df35fd94f741fc55ed838 *DESCRIPTION
-f97529155d77c26dbcb3474d36276344 *NAMESPACE
-a4db2cb234d3e223e097567c1a9063e7 *R/draw_key_hexagon.r
-b3e78724e6078c0338e8c1222a79df2b *R/function_list.r
-7e8eeeb51903167cc1d28d4bee8d9b16 *R/stat_summaries_hex.r
-ba47a6501b2900d643aa513e210666ab *README.md
-2e6e2c6d1d8630395d97a17fbe299b53 *man/draw_key_hexagon.Rd
-f8cb3b22ab833aba777e6c7547c8c952 *man/normalize_function_list.Rd
-b54a0790f52de729765827ac747a1771 *man/stat_summaries_hex.Rd
diff --git a/R/stat_summaries_hex.r b/R/stat_summaries_hex.r
index 5301906..7f3c7d8 100644
--- a/R/stat_summaries_hex.r
+++ b/R/stat_summaries_hex.r
@@ -18,11 +18,11 @@
#' library(ggplot2)
#' # Define the variable used for the stats using z
#' ggplot_base <- ggplot(iris, aes(Sepal.Width, Sepal.Length, z = Petal.Width))
-#' # The default is creating `stat(value)` containing the mean
-#' ggplot_base + stat_summaries_hex(aes(fill = stat(value)), bins = 5)
+#' # The default is creating `after_stat(value)` containing the mean
+#' ggplot_base + stat_summaries_hex(aes(fill = after_stat(value)), bins = 5)
#' # but you can specify your own stats
#' ggplot_base + stat_summaries_hex(
-#' aes(fill = stat(median), alpha = stat(n)),
+#' aes(fill = after_stat(median), alpha = after_stat(n)),
#' funs = c('median', n = 'length'),
#' bins = 5)
#'
@@ -63,8 +63,9 @@ stat_summaries_hex <- function(
StatSummariesHex <- ggproto(
'StatSummariesHex',
Stat,
- #default_aes = aes(fill = stat(value)),
+ #default_aes = aes(fill = after_stat(value)),
required_aes = c('x', 'y', 'z'),
+ dropped_aes = c('z'),
compute_group = function(
data, scales,
binwidth = NULL, bins = 30,
@@ -77,7 +78,7 @@ StatSummariesHex <- ggproto(
funs <- as.list(normalize_function_list(funs)) # if it was no list before, adding a function makes it one
funs$`_dummy` <- function(x) 1 # hexBinSummarise ruins our day if we have less than two items in the list
idx_dummy <- names(funs) %in% '_dummy'
- if (sum(idx_dummy) > 1L) stop('You cannot name a function `_dummy_, sorry.')
+ if (sum(idx_dummy) > 1L) stop('You cannot name a function `_dummy`, sorry.')
fun <- function(x) sapply(funs, exec, x, simplify = FALSE)
diff --git a/README.md b/README.md
index 10c5d99..2e868a9 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
-ggplot.multistats [![Workflow badge][]](https://github.com/flying-sheep/ggplot.multistats/commits/master)
-=================
+[![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.svg
-<!-- badges: start -->
-<!-- badges: end -->
+ggplot.multistats
+=================
`ggplot.multistats` currently provides `stat_summaries_hex` and some helpers.
@@ -26,7 +26,7 @@ devtools::install_github('flying-sheep/ggplot.multistats')
Example
-------
Specify a summary variable using the `z` aesthetic
-and specify a list of `funs` to provide `stat`s for you:
+and specify a list of `funs` to provide `after_stat`s for you:
```r
library(ggplot2)
@@ -34,7 +34,7 @@ library(ggplot.multistats)
ggplot(iris, aes(Sepal.Width, Sepal.Length)) +
stat_summaries_hex(
- aes(z = Petal.Width, fill = stat(median), alpha = stat(n)),
+ aes(z = Petal.Width, fill = after_stat(median), alpha = after_stat(n)),
funs = c('median', n = 'length'),
bins = 5
)
diff --git a/debian/changelog b/debian/changelog
index 84e412b..c615b6d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+r-cran-ggplot.multistats (1.0.1-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk> Thu, 19 Jan 2023 22:48:06 -0000
+
r-cran-ggplot.multistats (1.0.0-2) unstable; urgency=medium
* debhelper-compat 13 (routine-update)
diff --git a/man/stat_summaries_hex.Rd b/man/stat_summaries_hex.Rd
index 73c8ec0..ac33c5c 100644
--- a/man/stat_summaries_hex.Rd
+++ b/man/stat_summaries_hex.Rd
@@ -4,42 +4,59 @@
\alias{stat_summaries_hex}
\alias{StatSummariesHex}
\title{Multi-Stat Binning Layer}
-\format{An object of class \code{StatSummariesHex} (inherits from \code{Stat}, \code{ggproto}, \code{gg}) of length 3.}
+\format{
+An object of class \code{StatSummariesHex} (inherits from \code{Stat}, \code{ggproto}, \code{gg}) of length 4.
+}
\usage{
-stat_summaries_hex(mapping = NULL, data = NULL, geom = "hex",
- position = "identity", ..., bins = 30, binwidth = NULL,
- drop = TRUE, funs = c(value = "mean"), na.rm = FALSE,
- show.legend = NA, inherit.aes = TRUE, key_glyph = NULL)
+stat_summaries_hex(
+ mapping = NULL,
+ data = NULL,
+ geom = "hex",
+ position = "identity",
+ ...,
+ bins = 30,
+ binwidth = NULL,
+ drop = TRUE,
+ funs = c(value = "mean"),
+ na.rm = FALSE,
+ show.legend = NA,
+ inherit.aes = TRUE,
+ key_glyph = NULL
+)
StatSummariesHex
}
\arguments{
-\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
-\code{\link[=aes_]{aes_()}}. If specified and \code{inherit.aes = TRUE} (the
-default), it is combined with the default mapping at the top level of the
-plot. You must supply \code{mapping} if there is no plot mapping.}
+\item{mapping}{Set of aesthetic mappings created by \code{\link[ggplot2:aes]{aes()}}. If specified and
+\code{inherit.aes = TRUE} (the default), it is combined with the default mapping
+at the top level of the plot. You must supply \code{mapping} if there is no plot
+mapping.}
\item{data}{The data to be displayed in this layer. There are three
options:
If \code{NULL}, the default, the data is inherited from the plot
-data as specified in the call to \code{\link[=ggplot]{ggplot()}}.
+data as specified in the call to \code{\link[ggplot2:ggplot]{ggplot()}}.
A \code{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
-\code{\link[=fortify]{fortify()}} for which variables will be created.
+\code{\link[ggplot2:fortify]{fortify()}} for which variables will be created.
A \code{function} will be called with a single argument,
the plot data. The return value must be a \code{data.frame}, and
will be used as the layer data. A \code{function} can be created
from a \code{formula} (e.g. \code{~ head(.x, 10)}).}
-\item{geom}{The geometric object to use display the data}
+\item{geom}{The geometric object to use to display the data, either as a
+\code{ggproto} \code{Geom} subclass or as a string naming the geom stripped of the
+\code{geom_} prefix (e.g. \code{"point"} rather than \code{"geom_point"})}
-\item{position}{Position adjustment, either as a string, or the result of
-a call to a position adjustment function.}
+\item{position}{Position adjustment, either as a string naming the adjustment
+(e.g. \code{"jitter"} to use \code{position_jitter}), or the result of a call to a
+position adjustment function. Use the latter if you need to change the
+settings of the adjustment.}
-\item{...}{Other arguments passed on to \code{\link[=layer]{layer()}}. These are
+\item{...}{Other arguments passed on to \code{\link[ggplot2:layer]{layer()}}. These are
often aesthetics, used to set an aesthetic to a fixed value, like
\code{colour = "red"} or \code{size = 3}. They may also be parameters
to the paired geom/stat.}
@@ -67,7 +84,7 @@ display.}
\item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics,
rather than combining with them. This is most useful for helper functions
that define both data and aesthetics and shouldn't inherit behaviour from
-the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
+the default plot specification, e.g. \code{\link[ggplot2:borders]{borders()}}.}
\item{key_glyph}{A legend key drawing function or a string providing
the function name minus the \code{draw_key_} prefix.
@@ -81,11 +98,11 @@ for multiple stats to be captured using the \code{funs} parameter.
library(ggplot2)
# Define the variable used for the stats using z
ggplot_base <- ggplot(iris, aes(Sepal.Width, Sepal.Length, z = Petal.Width))
-# The default is creating `stat(value)` containing the mean
-ggplot_base + stat_summaries_hex(aes(fill = stat(value)), bins = 5)
+# The default is creating `after_stat(value)` containing the mean
+ggplot_base + stat_summaries_hex(aes(fill = after_stat(value)), bins = 5)
# but you can specify your own stats
ggplot_base + stat_summaries_hex(
- aes(fill = stat(median), alpha = stat(n)),
+ aes(fill = after_stat(median), alpha = after_stat(n)),
funs = c('median', n = 'length'),
bins = 5)
Debdiff
File lists identical (after any substitutions)
Control files: lines which differ (wdiff format)
Depends: r-base-core (>= 4.3.0-1~jan+lint2), 4.2.2.20221110-1), r-api-4.0, r-cran-rlang, r-cran-scales, r-cran-hexbin, r-cran-ggplot2 (>= 3.3.0)