ipat | R Documentation |
Logically index, numerically index, and count the number of times a pattern occurs.
ipat(x, pat)
has_pat(x, pat)
wpat(x, pat)
npat(x, pat)
ppat(x, pat)
ppats(x, pat)
x |
A character vector. |
pat |
A fixed value complete string scalar pattern to search for in |
has_pat | Evaluates whether each element of x contains the string in pat . |
ppats | Identifies the position of the first character of every instance of a pattern in each element of a character vector. |
ppat | Identifies the position of the first character of the first instance of a pattern in each element of a character vector. |
npat | Counts the number of times a pattern appears in each element of a character vector. |
ipat | Logically indexes character vector elements containing a pattern as TRUE or FALSE . |
wpat | Numerically indexes character vector elements containing a pattern as integer element numbers. |
These functions Always atomizes ...
to create a single character vector to search for a fixed pattern.
A positive whole number vlist
ppats
A positive whole number vector
wpat, npat, ppat
A logical scalar
has_pat, ipat
Other strings:
blank()
,
chn()
,
delim()
,
fsub()
,
gr
,
makestr()
,
markdown_help()
,
maxnch()
,
ox()
,
ox_vals()
,
pgrid_help()
,
revstr()
,
spaces()
,
ss_help()
,
tocase()
,
weave()
words <- c("apple", "banana", "carrot")
has_pat(words, "a")
ipat(words, "a")
has_pat(words, "b")
ipat(words, "b")
wpat(words, "a")
wpat(words, "b")
npat(words, "a")
npat(words, "b")
ppat(words, "a")
ppat(words, "b")
ppats(words, "a")
ppats(words, "b")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.