Description Usage Arguments Details Value Examples
Finds the first feature in a feature matrix that has its specified element at a given key equal to a given target. If no feature satisfies the requirement, counts how many features have, at the same key, an element strictly less than the target (its rank in the matrix).
1 | findFirstFeature(sortedFeatureMatrix, key = RT_IDX, target = 0)
|
sortedFeatureMatrix |
The sorted feature matrix to search. |
key |
The column in the matrix to search in. |
target |
The target value to search for, as a number. |
This function uses binary search to find the feature, so the feature matrix must be sorted ascending in the key column. Otherwise there is no guarantee that the search will yield the correct result.
The index of the first feature that has its element at the given key equal to the given target, if it exists; the feature's rank otherwise.
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.