const { curry, pipe, toPairs, sortWith, descend, ascend, nth, dropLast, sortBy, pluck } = R
const fn = curry((dropNum, sorter, arr) => pipe(
toPairs, // convert to [index, value] pairs
sortWith([sorter(nth(1))]), // sort by the value ascending or descending
dropLast(dropNum), // remove the last items
sortBy(nth(0)), // sort by index to restore order
pluck(1) // take the values
)(arr))
const arr = [1.20, 0.50, 2.00, 0.75, 1.20, 0.75, 0.75]
const remove3lowest = fn(3, descend)
const remove4higesht = fn(4, ascend)
console.log(remove3lowest(arr))
console.log(remove4higesht(arr))
.as-console-wrapper { max-height: 100% !important; top: 0; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.28.0/ramda.min.js" integrity="sha512-t0vPcE8ynwIFovsylwUuLPIbdhDj6fav2prN9fEu/VYBupsmrmk9x43Hvnt+Mgn2h5YPSJOk7PMo9zIeGedD1A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>