shikokuchuo / mirai

mirai - Minimalist Async Evaluation Framework for R
https://shikokuchuo.net/mirai/
GNU General Public License v3.0
193 stars 10 forks source link

`mirai_map()` fails when mapping a list of matrices or list of dataframes #149

Closed shikokuchuo closed 2 months ago

shikokuchuo commented 2 months ago

The current implementation assumes the matrices / dataframes are vectors, not taking into account that they have dim attributes.

More broadly though, when supplying a list of things, the expectation is likely to just map over the list as per lapply() or purrr::map().

So let's limit the 2D or multiple-map to dataframe / matrix objects, which are clearly '2D'. The expectation then should reasonably be to map over the rows.

Originally raised by andrewGhazi in #147.