data.table (version 1.7.9)

like: Convenience function for calling regexpr.

Description

Intended for use in [.data.table i.

Usage

like(vector,pattern)
vector

Arguments

vector
Either a character vector or a factor. A factor is faster.
pattern
Passed on to regexpr.

Value

  • Integer vector containing the locations of vector which match the pattern using regexpr.

See Also

data.table, regexpr

Examples

Run this code
DT = data.table(Name=c("Mary","George","Martha"), Salary=c(2,3,4))
    DT[Name %like% "^Mar"]

Run the code above in your browser using DataCamp Workspace