Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly specify argument 'tied.method' when calling matrixStats::rowRanks() #2

Closed
HenrikBengtsson opened this issue Apr 10, 2024 · 1 comment

Comments

@HenrikBengtsson
Copy link

HenrikBengtsson commented Apr 10, 2024

TL;DR

Whenever calling colRanks() or rowRanks() from matrixStats, please specify argument ties.method explicitly. In future releases of matrixStats, it will be an error if not doing so.

We will roll out this change slowly. First users of your package will see warnings, which are non-breaking. Only in a later release, matrixStats will produce errors, which then are breaking.

To be ahead of this, please update your package to explicitly specify the ties.method argument.

Background

The matrixStats package will eventually require that argument ties.method of colRanks() and rowRanks() is explicitly specified. Relying on the default value will become deprecated, and eventually also defunct. For example, instead of calling colRanks(X), one could specify colRanks(X, ties.method = "max") or colRanks(X, ties.method = "average").

The reason for this is that the default ties.method value for colRanks() and rowRanks() is currently ties.method = "max", whereas the corresponding one for base::rank() is ties.method = "average". We want the matrixStats functions to eventually also default to ties.method = "average". In order to do so, we cannot just switch from one version to the other, because that would change the result. You can read about this in HenrikBengtsson/matrixStats#142.

This is why we are reaching out to you, so you can make sure to use the ties.method that you intended. When scanning packages that use colRanks() and rowRanks() of matrixStats without specifying the ties.method argument, your package came up. See below for details.

Details

We ran reverse-package dependency checks (R CMD check) with environment variable R_MATRIXSTATS_TIES_METHOD_MISSING=defunct to detect with missing ties.method argument. Your package came up with the following:

* using log directory ‘/c4/home/henrik/repositories/matrixStats/revdep/checks/rpm/new/rpm.Rcheck’
* using R version 4.3.3 (2024-02-29)
* using platform: x86_64-pc-linux-gnu (64-bit)
* R was compiled by
    gcc (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11)
    GNU Fortran (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11)
* running under: CentOS Linux 7 (Core)
* using session charset: UTF-8
* using option ‘--no-manual’
* checking for file ‘rpm/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘rpm’ version ‘0.7-1’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘rpm’ can be installed ... WARNING
Found the following significant warnings:
  /c4/home/henrik/repositories/matrixStats/revdep/library/rpm/RcppArmadillo/include/armadillo_bits/fn_reshape.hpp:63:13: warning: ‘arma::Mat<typename T1::elem_type> arma::reshape(const arma::Base<typename T1::elem_type, T1>&, arma::uword, arma::uword, arma::uword)’ is deprecated: don't use this form: it will be removed [-Wdeprecated-declarations]
  /c4/home/henrik/repositories/matrixStats/revdep/library/rpm/RcppArmadillo/include/armadillo_bits/fn_reshape.hpp:65:7: warning: ‘arma::Mat<typename T1::elem_type> arma::reshape(const arma::Base<typename T1::elem_type, T1>&, arma::uword, arma::uword, arma::uword)’ is deprecated: don't use this form: it will be removed [-Wdeprecated-declarations]
  /c4/home/henrik/repositories/matrixStats/revdep/library/rpm/RcppArmadillo/include/armadillo_bits/fn_reshape.hpp:74:9: warning: ‘arma::Mat<typename T1::elem_type> arma::reshape(const arma::Base<typename T1::elem_type, T1>&, arma::uword, arma::uword, arma::uword)’ is deprecated: don't use this form: it will be removed [-Wdeprecated-declarations]
See ‘/c4/home/henrik/repositories/matrixStats/revdep/checks/rpm/new/rpm.Rcheck/00install.out’ for details.
* used C++ compiler: ‘g++ (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11)’
* checking installed package size ... NOTE
  installed size is 11.6Mb
  sub-directories of 1Mb or more:
    libs  11.1Mb
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for GNU extensions in Makefiles ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking use of PKG_*FLAGS in Makefiles ... OK
* checking compiled code ... OK
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ... ERROR
  Running ‘tests.R’
Running the tests in ‘tests/tests.R’ failed.
Complete output:
  > 
  > library(testthat)
  > library(rpm)
  Loading required package: abind
  Loading required package: future
  Loading required package: doRNG
  Loading required package: foreach
  Loading required package: rngtools
  > 
  > test_check("rpm")
  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 0 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-fauxmatching.R:6:3'): rpm-fit ──────────────────────────────────
  <defunctError/error/condition>
  Error: [matrixStats] Please explicitly specify argument 'ties.method' when calling colRanks() and rowRanks() of matrixStats. This is because the current default ties.method="max" will eventually be updated to ties.method="average" in order to align with the default of base::rank()
  Backtrace:
      ▆
   1. └─rpm::rpm(...) at test-fauxmatching.R:6:3
   2.   └─rpm::rpm_MLPLE(...)
   3.     └─rpm:::rpm.bootstrap.small(...)
   4.       └─rpm::Gale_Shapley(...)
   5.         └─matrixStats::rowRanks(U)
   6.           └─matrixStats:::tiesMethodMissing()
   7.             └─base (local) action(...)
  
  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 0 ]
  Error: Test failures
  Execution halted
* DONE
Status: 1 ERROR, 1 WARNING, 1 NOTE
@handcock
Copy link
Owner

Thanks for pointing it out. Now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants