YuanTian1991 / ChAMP

19 stars 22 forks source link

Update champ.SVD.R to work with R >= 4.0 #31

Open voudiou opened 1 year ago

voudiou commented 1 year ago

Checking class(beta) will return "matrix" and "array" (if beta is a matrix) since R 4.0.0, breaking champ.SVD.

https://cran.r-project.org/doc/manuals/r-release/NEWS.html "matrix objects now also inherit from class "array", so e.g., class(diag(1)) is c("matrix", "array"). This invalidates code incorrectly assuming that class(matrix_obj)) has length one."

Checking with inherits work before and after 4.0.0.