abess-team / abess

Fast Best-Subset Selection Library
https://abess.readthedocs.io/
Other
474 stars 41 forks source link

update R package Matrix API 'as()' #446

Closed bbayukari closed 2 years ago

bbayukari commented 2 years ago

change methods::as(sparse.loading, "dgCMatrix") into as(as(as(sparse.loading, "dMatrix"), "generalMatrix"), "CsparseMatrix") in R-package/R/generate.spc.matrix.R

codecov[bot] commented 2 years ago

Codecov Report

Merging #446 (2e9eb34) into master (df2c56b) will decrease coverage by 3.64%. The diff coverage is n/a.

:exclamation: Current head 2e9eb34 differs from pull request most recent head 7577db9. Consider uploading reports for the commit 7577db9 to get more accurate results

@@            Coverage Diff             @@
##           master     #446      +/-   ##
==========================================
- Coverage   93.52%   89.88%   -3.65%     
==========================================
  Files          29        9      -20     
  Lines        3212     1186    -2026     
==========================================
- Hits         3004     1066    -1938     
+ Misses        208      120      -88     
Flag Coverage Δ
Python 89.88% <ø> (ø)
rpackage ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
R-package/R/generate.spc.matrix.R
R-package/R/initialization.R
R-package/R/utility.R
R-package/R/generate.data.R
R-package/R/predict.abess.R
R-package/R/plot.abessrpca.R
R-package/R/extract.abess.R
R-package/R/generate.matrix.R
R-package/R/coef.abess.R
R-package/R/abesspca.R
... and 10 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Mamba413 commented 2 years ago

change methods::as(sparse.loading, "dgCMatrix") into as(as(as(sparse.loading, "dMatrix"), "generalMatrix"), "CsparseMatrix") in R-package/R/generate.spc.matrix.R

I notice that you change

sparse.loading <- methods::as(sparse.loading, "dgCMatrix")

to:

sparse.loading <- as(as(as(sparse.loading, "dMatrix"), "generalMatrix"), "CsparseMatrix")

Three additional steps are required. First, find out the package that includes the three as functions. Suppose this package is abc, then you should add

#' @importFrom abd as

into the abess-package.R file. Second, remove

#' @importFrom method as

in abess-package.R file.

Mamba413 commented 2 years ago

@bbayukari , moreover, the R build fails on all platforms, please address them.