RAPLER / dst-1

Combine basic probability assignments with Dempster's rule of combination
6 stars 3 forks source link

No method or default for coercing “matrix” to “RsparseMatrix” #41

Closed garyzhubc closed 4 months ago

garyzhubc commented 7 months ago

at times I run into this type of error:

Error in methods::as(bma$tt, "RsparseMatrix") : 
  no method or default for coercing “matrix” to “RsparseMatrix”
Execution halted
RAPLER commented 7 months ago

Can you tell me in which function this occurs?

garyzhubc commented 7 months ago

It was when I'm converting regular matrix into sparse matrix

bma$tt <- methods::as(bma$tt, "RsparseMatrix")
RAPLER commented 7 months ago

In which function of the package?

C. B.

Le 14 mars 2024 à 17:13, Peiyuan Zhu @.***> a écrit :

 It was when I'm converting regular matrix into sparse matrix

bma$tt <- methods::as(bma$tt, "RsparseMatrix") — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

garyzhubc commented 7 months ago

It’s not part of the package, but an issue that I have in converting sparse matrix as required by the package. Sent from my iPhoneOn Mar 14, 2024, at 2:28 PM, Claude Boivin @.***> wrote: In which function of the package?

C. B.

Le 14 mars 2024 à 17:13, Peiyuan Zhu @.***> a écrit :



It was when I'm converting regular matrix into sparse matrix

bma$tt <- methods::as(bma$tt, "RsparseMatrix")

Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you commented.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

RAPLER commented 7 months ago

I have already run into this problem, although it was within the package. I solved this by adding the package "methods" in the imports of the DESCRIPTION file. If the problem arise in a function you have defined, you may need to add: @import methods see this page on stackoverflow website: https://stackoverflow.com/questions/36432248/error-in-asdata-transactions-no-method-or-default-for-coercing-data-to