Open Fuco1 opened 6 years ago
This should return the index of the min/max element in the list.
Simple implementation is
(car (-grade-up '< '(3 4 1 0 2))) ;; => minimum is at index 3 (car (-grade-down '< '(3 4 1 0 2))) ;; => maximum is at intex 1
R call these functions which.min and which.max. See https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/which.min
which.min
which.max
See also Proposal add -which -- Return indices where the list entry is non-nil
This should return the index of the min/max element in the list.
Simple implementation is