We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad2e22d commit 172c0a7Copy full SHA for 172c0a7
R/like.R
@@ -2,6 +2,7 @@
2
# Don't use * or % like SQL's like. Uses regexpr syntax - more powerful.
3
# returns 'logical' so can be combined with other where clauses.
4
like = function(vector, pattern, ignore.case = FALSE, fixed = FALSE, perl = FALSE) {
5
+ # TODO(R>=4.1.0): grepl itself has "smarter" logic for factor input.
6
if (is.factor(vector)) {
7
# indexing by factors is equivalent to indexing by the numeric codes, see ?`[` #4748
8
ret = grepl(pattern, levels(vector), ignore.case = ignore.case, fixed = fixed, perl = perl)[vector]
0 commit comments