Skip to content

Commit

Permalink
deprecate scale stat + update news with deprecation & unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
corybrunson committed Feb 9, 2025
1 parent 470074c commit 62e2cc9
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 20 deletions.
22 changes: 16 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# next version

## infrastructure and standards

### wrapper defaults

Previously, `lda_ord()` mimicked `MASS::lda()` in defaulting the retrieval parameters `ret.x` and `ret.grouping` to `FALSE`.
Because they are so important to analysis and especially to biplots, they now default to `TRUE`.

### unit tests

Unit tests have been written for all ggproto shortcuts.

## upgrades to the biplot chassis

### axis harmonizers
Expand All @@ -21,7 +32,7 @@ The `elements` parameter is now standardized across all statistical transformati
The value is argument-matched to `"active"`, `"score"`, or `"structure"`; these options may expand as additional supplementary elements are introduced.
Moreover, the former default `"all"` is no longer accepted, which forecloses the trick of passing the element type to an aesthetic, e.g. `size = .element == "active"`, as had been used in several examples.

## upgrades to existing plot layers
## up( or down)grades to existing plot layers

### combined vector and radiating text geom (breaking change)

Expand All @@ -43,6 +54,10 @@ Previously, underscore-separated parameters like `label_colour` were used to spe
Their behavior has been debugged by mimicking the use of period-separated parameters like `label.colour` in **ggplot2** v3.5.1, except for the new bagplot geom, for which their behavior is based on that of `geom_boxplot()` in the current development version of {ggplot2}.
This induces some breaking changes due to the renaming of most, and the removal of some, such parameters.

### deprecation of scale stat

The simple and experimental `StatScale` has been deprecated.

## new plot layers

### addition geom
Expand Down Expand Up @@ -74,11 +89,6 @@ A new 'depth' statistical transformation estimates depth across a grid and is pa
Aided by element standardization, the classic `density_2d` statistical transformation and geometric construction are adapted to biplots.
Currently, source code generation does not respect fixed parameters passed to `layer()` by the `stat_*()` and `geom_*()` shortcuts; as a consequence, `contour = TRUE` must be manually passed to `geom_*_density_2d()`.

## miscellany

Previously, `lda_ord()` mimicked `MASS::lda()` in defaulting the retrieval parameters `ret.x` and `ret.grouping` to `FALSE`.
Because they are so important to analysis and especially to biplots, they now default to `TRUE`.

# ordr 0.1.1

## `linewidth` aesthetic (breaking change)
Expand Down
2 changes: 1 addition & 1 deletion R/stat-center.r
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' @template param-stat
#' @template return-layer
#' @family stat layers
#' @example inst/examples/ex-stat-center-iris.r
#' @example inst/examples/ex-stat-center.r
#' @export
stat_center <- function(
mapping = NULL, data = NULL, geom = "point", position = "identity",
Expand Down
7 changes: 5 additions & 2 deletions R/stat-scale.r
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#' @title Multiply artificial coordinates by a scale factor
#'
#'
#' @description
#' This layer is **deprecated**.
#'

#' @template biplot-layers
#' @template biplot-ord-aes
Expand All @@ -10,7 +13,6 @@
#' @template param-stat
#' @template return-layer
#' @family stat layers
#' @example inst/examples/ex-stat-scale.r
#' @export
stat_scale <- function(
mapping = NULL, data = NULL, geom = "point", position = "identity",
Expand Down Expand Up @@ -45,6 +47,7 @@ StatScale <- ggproto(
required_aes = c("x", "y"),

compute_group = function(data, scales, mult = 1) {
warning("`StatScale` is deprecated and will be removed next release.")
data[, c("x", "y")] <- data[, c("x", "y")] * mult
data
}
Expand Down
4 changes: 0 additions & 4 deletions inst/examples/ex-stat-scale.r

This file was deleted.

9 changes: 9 additions & 0 deletions man/stat_center.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions man/stat_scale.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 62e2cc9

Please sign in to comment.