locate: Position of the first pattern match

View source: R/primitives.R

locateR Documentation

Position of the first pattern match

Description

Position of the first pattern match

Usage

locate(x, pattern, fixed = FALSE)

Arguments

x

An atomic vector.

pattern

A regular expression (or fixed string when fixed = TRUE).

fixed

Use fixed (non-regex) matching instead of regular expressions.

Value

An integer vector of match positions (see regexpr()).


basetable documentation built on Sept. 18, 2026, 9:13 a.m.