Giter VIP home page Giter VIP logo

Comments (3)

dwbapst avatar dwbapst commented on September 25, 2024 1

It might be equivalent, but I think current best practice is to use inherits instead, for example:

> x <- matrix(1:9, 3, 3)
> inherits(x, "matrix")
[1] TRUE

The change from using only 'matrix' for a 'matrix' to also giving it class 'array' was telegraphed a while ago. I think package authors received notice via email from CRAN... ah, yes, Dec 4th from Kurt H.:

Dear maintainer,

Please see the problems shown on
https://cran.r-project.org/web/checks/check_results_paleotree.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., .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.

Best,
-k

Well, apparently it was telegraphed to those of us for whom it broke our packages on CRAN...

from disprity.

TGuillerme avatar TGuillerme commented on September 25, 2024

The R_CLASS_MATRIX_ARRAY changes for Rv4 were implemented in dispRity 1.4 (https://github.com/TGuillerme/dispRity/blob/master/NEWS.md) that I think was running fine for Rv3 users (i.e. I wasn't aware of any issue). The newest version (dispRity 1.5) now has more checks for the class of the input for the new functionalities that were the cause of version change.

I've taken the change from @josephwb credited in the NEWS.md and reverted the version number to Rv1.6.

This is now deployed on the master and release branches so that

devtools::install_github("TGuillerme/dispRity", ref = "release")

or

devtools::install_github("TGuillerme/dispRity")

Should work for older R versions (@josephwb, please let me know if it's the case so that I can close this issue).

from disprity.

josephwb avatar josephwb commented on September 25, 2024

Installed and running. Thanks.

from disprity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.