Skip to content

Rowwise doesn't work with grepl #1099

@pwalaszek

Description

@pwalaszek

Hi,
I try to use grepl with rowwise and it doesn't work. Even when I use rowwise grepl takes all rows together. Small example: I want to find rows where First is in Second string:

library(dplyr)
df = data_frame(First = c("string1", "string2"), Second = c("Sentence with string1", "something"))
df %>%
  rowwise() %>%
  filter(grepl(First, Second, fixed = TRUE))

I got warning:
Warning message:
In grepl(c("string1", "string2"), c("Sentence with string1", "something" :
argument 'pattern' has length > 1 and only the first element will be used

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions