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

new matrix classes for R 4.0.0 #422

Closed
topepo opened this issue Dec 4, 2019 · 2 comments
Closed

new matrix classes for R 4.0.0 #422

topepo opened this issue Dec 4, 2019 · 2 comments

Comments

@topepo
Copy link
Member

topepo commented Dec 4, 2019

Dear maintainer,

Please see the problems shown on
https://cran.r-project.org/web/checks/check_results_recipes.html.

Specifically, see the problems shown for the r-devel Debian checks.

These can be reproduced by checking with --as-cran using current
r-devel, which for now sets

_R_CLASS_MATRIX_ARRAY_=true 

in the check environment, to the effect that

R> class(matrix(1 : 4, 2, 2)) 
[1] "matrix" "array" 

(and no longer just "matrix" as before).

According to the R NEWS file,

For now only active when environment variable R_CLASS_MATRIX_ARRAY
is set to non-empty, but planned to be the new unconditional behavior
when R 4.0.0 is released:

matrix objects now also inherit from class "array", namely, e.g.,
class(diag(1)) is c("matrix", "array") which invalidates code
assuming that length(class(obj)) == 1, an incorrect assumption that
is less frequently fulfilled now.

S3 methods for "array", i.e., <someFun>.array(), are now also
dispatched for matrix objects.

Apparently your package no longer works correctly when
class(matrix(...)) gives a vector of length two: please fix as
necessary.

See
https://developer.r-project.org/Blog/public/2019/11/09/when-you-think-class.-think-again/index.html
for more information about correctly using class() in package code.

Please correct before 2019-12-18 to safely retain your package on CRAN.

@topepo
Copy link
Member Author

topepo commented Dec 15, 2019

Closed by 830b55d

@topepo topepo closed this as completed Dec 15, 2019
linnykos added a commit to linnykos/esvd that referenced this issue Jan 31, 2021
There's a change with the UseMethod function (see https://cran.r-project.org/doc/manuals/r-release/NEWS.2.pdf)
  which prevents me from using the class to store dat or dat_vec's family. (In retrospect, this should've
  either been an attribute or stored as a separate object.) Also, matrices now also have the "array"
  class (see tidymodels/recipes#422) which causes additional issues. For
  example, I now need to suppress warnings for clplite.
@github-actions
Copy link

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant