locate {SparkR}R Documentation

locate

Description

Locate the position of the first occurrence of substr. NOTE: The position is not zero based, but 1 based index, returns 0 if substr could not be found in str.

Usage

## S4 method for signature 'character,Column'
locate(substr, str, pos = 1)

locate(substr, str, ...)

Arguments

substr

a character string to be matched.

str

a Column where matches are sought for each entry.

pos

start position of search.

...

further arguments to be passed to or from other methods.

Note

locate since 1.5.0

See Also

Other string_funcs: ascii, ascii, ascii,Column-method; base64, base64, base64,Column-method; concat_ws, concat_ws, concat_ws,character,Column-method; concat, concat, concat,Column-method; decode, decode, decode,Column,character-method; encode, encode, encode,Column,character-method; format_number, format_number, format_number,Column,numeric-method; format_string, format_string, format_string,character,Column-method; initcap, initcap, initcap,Column-method; instr, instr, instr,Column,character-method; length, length,Column-method; levenshtein, levenshtein, levenshtein,Column-method; lower, lower, lower,Column-method; lpad, lpad, lpad,Column,numeric,character-method; ltrim, ltrim, ltrim,Column-method; regexp_extract, regexp_extract, regexp_extract,Column,character,numeric-method; regexp_replace, regexp_replace, regexp_replace,Column,character,character-method; reverse, reverse, reverse,Column-method; rpad, rpad, rpad,Column,numeric,character-method; rtrim, rtrim, rtrim,Column-method; soundex, soundex, soundex,Column-method; substring_index, substring_index, substring_index,Column,character,numeric-method; translate, translate, translate,Column,character,character-method; trim, trim, trim,Column-method; unbase64, unbase64, unbase64,Column-method; upper, upper, upper,Column-method

Examples

## Not run: locate('b', df$c, 1)

[Package SparkR version 2.0.1 Index]