find_first: Return index of from which is firstly matched to the argument

View source: R/algorithm.R

find_firstR Documentation

Return index of from which is firstly matched to the argument

Description

Find first index number in from at which is equal to what.

Usage

find_first(what, from, condition = `==`)

Arguments

what

value of sequence for finding

from

index of this argument is returned

condition

condition for finding. Default is "=="

Value

List of index which is found in from. NA if it is not found.

Examples

find_first(c(1,3,5), c(0,1,2,3,3))
# c(2,4,NA)

hmito/hmRLib documentation built on March 13, 2024, 9:41 p.m.