Skip to content

Commit

Permalink
DEPRECATION: Not specifying argument 'ties.method' for colRanks() and…
Browse files Browse the repository at this point in the history
… rowRanks() will become deprecated in R (>= 4.4.0) [#142]
  • Loading branch information
HenrikBengtsson committed Apr 10, 2024
1 parent 9c28f14 commit ca51e52
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: matrixStats
Version: 1.2.0-9017
Version: 1.2.0-9018
Depends:
R (>= 2.12.0)
Suggests:
Expand Down
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@

## Deprecated and Defunct

* Calling `colRanks()` and `rowRanks()` without explicitly specifying
argument `ties.method` will be deprecated when using R (>=
4.4.0). The reason is that the current default is `ties.method =
"max"`, but we want to change that to `ties.method = "average"` to
align it with `base::rank()`. In order to minimize the risk for
sudden changes in results, we ask everyone to explicitly specify
their intent. The first notice will be through deprecation
warnings, which will only occur every 50:th call to keep the noise
level down. We will make it more noisy in future releases, and
eventually also escalated to defunct errors.

* Using a scalar value for argument `center` of `colSds()`,
`rowSds()`, `colVars()`, `rowVars()`, `colMads()`, `rowMads()`,
`colWeightedMads()`, and `rowWeightedMads()` is now defunct.
Expand Down
4 changes: 2 additions & 2 deletions R/options.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#' If \code{"defunct"}, an error is produced, if not.
#' If \code{"deprecated"}, a warning is signalled.
#' If \code{"ignore"}, it's silently ignored.
#' (Default: \code{"ignore"})}
#' (Default: \code{"deprecated"} in R (>= 4.4.0), otherwise \code{"ignore"})}
#' }
#'
#' \describe{
Expand Down Expand Up @@ -213,7 +213,7 @@ update_package_options <- function() {

update_package_option("matrixStats.useNames.NA", default = "defunct", choices = c("deprecated", "defunct"))

update_package_option("matrixStats.ties.method.missing", default = "ignore", choices = c("deprecated", "defunct", "ignore"))
update_package_option("matrixStats.ties.method.missing", default = if (getRversion() >= "4.4.0") "deprecated" else "ignore", choices = c("deprecated", "defunct", "ignore"))

update_package_option("matrixStats.ties.method.freq", mode = "numeric", default = "50")
}
6 changes: 3 additions & 3 deletions man/matrixStats.options.Rd

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

0 comments on commit ca51e52

Please sign in to comment.