EVOLUTION-MANAGER
Edit File: like.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Convenience function for calling grep.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for like {data.table}"><tr><td>like {data.table}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Convenience function for calling grep. </h2> <h3>Description</h3> <p>Intended for use in <code>i</code> in <code><a href="data.table.html">[.data.table</a></code>, i.e., for subsetting/filtering. </p> <p>Syntax should be familiar to SQL users, with interpretation as regex. </p> <h3>Usage</h3> <pre> like(vector, pattern, ignore.case = FALSE, fixed = FALSE) vector %like% pattern vector %ilike% pattern vector %flike% pattern </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>vector</code></td> <td> <p> Either a <code>character</code> or a <code>factor</code> vector. </p> </td></tr> <tr valign="top"><td><code>pattern</code></td> <td> <p> Pattern to be matched </p> </td></tr> <tr valign="top"><td><code>ignore.case</code></td> <td> <p><code>logical</code>; is <code>pattern</code> case-sensitive? </p> </td></tr> <tr valign="top"><td><code>fixed</code></td> <td> <p><code>logical</code>; should <code>pattern</code> be interpreted as a literal string (i.e., ignoring regular expressions)? </p> </td></tr> </table> <h3>Details</h3> <p>Internally, <code>like</code> is essentially a wrapper around <code><a href="../../base/html/grep.html">base::grepl</a></code>, except that it is smarter about handling <code>factor</code> input (<code>base::grep</code> uses slow <code>as.character</code> conversion). </p> <h3>Value</h3> <p>Logical vector, <code>TRUE</code> for items that match <code>pattern</code>. </p> <h3>Note</h3> <p> Current implementation does not make use of sorted keys. </p> <h3>See Also</h3> <p><code><a href="../../base/html/grep.html">base::grepl</a></code> </p> <h3>Examples</h3> <pre> DT = data.table(Name=c("Mary","George","Martha"), Salary=c(2,3,4)) DT[Name %like% "^Mar"] DT[Name %ilike% "mar"] DT[Name %flike% "Mar"] </pre> <hr /><div style="text-align: center;">[Package <em>data.table</em> version 1.14.4 <a href="00Index.html">Index</a>]</div> </body></html>