Winnie09 / Lamian

44 stars 10 forks source link

Add lapply to your mykmeans function #29

Open Alexis-Varin opened 6 months ago

Alexis-Varin commented 6 months ago

Hello, currently your infer_tree_structure() function fails on Windows computers if number.cluster parameter is kept on NA because your mykmeans() function which is called from infer_tree_structure() to calculate the number of clusters from k-means only uses mclapply() with a mc.cores parameter of 30. This will trigger the error seen in this issue #3 where mc.cores > 1 is not supported on Windows.

Your lamian_test() function correctly uses lapply() when ncores = 1 so please add the same option to mykmeans() and infer_tree_structure() so that we don't need to manually set the number of clusters (because this triggers indeed only when number.cluster = NA because that's the only parameter where mykmeans() is called).

ggruenhagen3 commented 4 months ago

It would be nice if the user could set how many cores they wanted to use too.

Alexis-Varin commented 4 months ago

It would be nice if the user could set how many cores they wanted to use too.

The pull request I adressed to Dr. Hou would allow that yes, adding an ncores parameter the user could keep as detectCores() or set to a fixed numeric value for desired number of cores to be used