-
Notifications
You must be signed in to change notification settings - Fork 47
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
stopping at first occurrency #232
Comments
maybe the name could be str_any() |
Sounds like a nice idea and not too much work. But:
|
Imagine I've just read a large csv file into a data.frame or data.table and I want to set properly the column classes. If there are many rows grep needs a long time to process every vector. Or in general this can be beneficial if you want to test many things in many vectors. |
Do you mean something like:
By the way, did you experience any real situation in practice, where |
yes, I mean something like that. Yes, I'm working with several datasets and in my tests, for this kind of work, stri_detect_regex is not faster than grep. I've posted an example at stackoverflow They give me some tricks but I thought it could be much better if grep had that option included. |
OK, this looks easy to implement. Will do that "in due time" |
Thank you. |
?self-note? |
DONE.
|
When working with vectors it would be great if functions such as stri_detect_regex had the option to stop when the first occurrency happen.
(Like grep -m parameter).
That would make many operations much faster, such as quickly detecting columns containing some string.
I've also asked the same for base R grep, but I guess they will need years to do it.
The text was updated successfully, but these errors were encountered: