gdkrmr / dimRed

A Framework for Dimensionality Reduction in R
https://www.guido-kraemer.com/software/dimred/
GNU General Public License v3.0
73 stars 15 forks source link

Sparse matrix error #47

Open grayskripko opened 4 years ago

grayskripko commented 4 years ago

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.

gdkrmr commented 4 years ago

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.

grayskripko commented 2 years ago

tidyverse works with it using warnings()