Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rowwise doesn't work with grepl #1099

Closed
pwalaszek opened this issue Apr 23, 2015 · 1 comment
Closed

Rowwise doesn't work with grepl #1099

pwalaszek opened this issue Apr 23, 2015 · 1 comment
Assignees
Milestone

Comments

@pwalaszek
Copy link

@pwalaszek pwalaszek commented Apr 23, 2015

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

@romainfrancois romainfrancois self-assigned this Apr 24, 2015
@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Apr 24, 2015

Actually filter does not know at all about rowwise and treats the data as if it was not rowwised.

@hadley hadley added this to the 0.5 milestone May 19, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants