RfastOfficial / Rfast

A collection of Rfast functions for data analysis. Note 1: The vast majority of the functions accept matrices only, not data.frames. Note 2: Do not have matrices or vectors with have missing data (i.e NAs). We do no check about them and C++ internally transforms them into zeros (0), so you may get wrong results. Note 3: In general, make sure you give the correct input, in order to get the correct output. We do no checks and this is one of the many reasons we are fast.
139 stars 19 forks source link

Argument `n` for rowMins and rowMaxs #15

Closed thiagoveloso closed 4 years ago

thiagoveloso commented 4 years ago

Thanks for the wonderful package.

Currently, rowMins and rowMaxs return respectively only the minimum and maximum values for each row.

It would be great to add an n argument to those functions, which would return the n (for example 5) smallest and largest numbers for each row.

As a result of the example above, 5 values would be returned for each row (and not just the 5th value). Does that feature sound useful for you guys as well?

ManosPapadakis95 commented 4 years ago

Actually you want a partial sorting. I already have this algorithm in colSort but not in cran yet. You can see a similar usage in Sort using argument partial.

thiagoveloso commented 4 years ago

Actually you want a partial sorting. I already have this algorithm in colSort but not in cran yet. You can see a similar usage in Sort using argument partial.

Cool! Looking forward to testing that functionality. Any ideia on when will it be on Cran?

ManosPapadakis95 commented 4 years ago

Unfortunately, in a few months.

ManosPapadakis95 commented 4 years ago

Done. But this feature will be added in colnth and rownth functions choosing the number of the returned values. For matter of speed the values will be sorted.