dimRed icon indicating copy to clipboard operation
dimRed copied to clipboard

Sparse matrix error

Open grayskripko opened this issue 5 years ago • 2 comments

I find it misleading trying to use embed() on a sparse matrix and don't get an error. After an investigation, I see a call of as.matrix() on my sparse matrix. I think it's reasonable to throw an error preventing a memory explosion. Even more, the call as.matrix() assumes a user can pass something else and the result can be unexpected. It's dangerous and in some point of view, in most cases, useless.

grayskripko avatar Nov 26 '19 11:11 grayskripko

That's the R philosophy :-), there is lots of code that does so. Also "dangerous" is a strong word, if you deal with medium size data in R you have to be aware of your memory footprint anyway.

Fun aside, thanks for reporting this, you are right and it makes sense to allow only matrices as input, still this is a code change that is breaking breaking and has to be considered carefully.

gdkrmr avatar Nov 26 '19 16:11 gdkrmr

tidyverse works with it using warnings()

grayskripko avatar Feb 18 '22 10:02 grayskripko