like

0th

Percentile

Convenience function for calling regexpr.

Intended for use in i in [.data.table.

Keywords
data
Usage
like(vector,pattern)
vector %like% pattern
Arguments
vector

Either a character vector or a factor. A factor is faster.

pattern

Passed on to grepl.

Value

Logical vector, TRUE for items that match pattern.

Note

Current implementation does not make use of sorted keys.

See Also

data.table, grepl

Aliases
  • like
  • %like%
Examples
# NOT RUN {
DT = data.table(Name=c("Mary","George","Martha"), Salary=c(2,3,4))
DT[Name %like% "^Mar"]
# }
Documentation reproduced from package data.table, version 1.12.0, License: MPL-2.0 | file LICENSE

Community examples

Looks like there are no examples yet.