grep() function in R Language is used to search for matches of a pattern within each element of the given string.
grep(pattern, x, ignore.case=TRUE/FALSE, value=TRUE/FALSE)
pattern: Specified pattern which is going to be matched with given elements of the string.
x: Specified string vector.
ignore.case: If its value is TRUE, it ignores case.
value: If its value is TRUE, it return the matching elements vector, else return the indices vector.
 2  3  2  3 4
 "GFG" "gfg"  "GFG" "gfg" "Geeks" "GEEKS"  3  4
- Extract word from a String at specified position in R Programming - word() Function
- Replace all the matches of a Pattern from a String in R Programming - gsub() Function
- Replace the First Match of a Pattern from a String in R Programming – sub() Function
- Seek a Match for the Pattern in the String in R Programming - pmatch() Function
- Get the position of the maximum element in each Row of a Matrix in R Programming - max.col() Function
- Check for a Pattern in the Vector in R Programming - grepl() Function
- Find String Matches in a Vector or Matrix in R Programming - str_detect() Function
- Check if a Function is a Primitive Function in R Programming - is.primitive() Function
- Convert string from lowercase to uppercase in R programming - toupper() function
- Matching of patterns in a String in R Programming - agrep() Function
- Substitute characters of a String in R Programming - chartr() Function
- Convert String to Double Quote Text in R Programming - dQuote() Function
- Convert String to Single Quote Text in R Programming - sQuote() Function
- Convert String to Integer in R Programming - strtoi() Function
- Print a Formatted string in R Programming - sprintf() Function
- Create Repetitions of a String in R Programming - strrep() Function
- Trim a String to a Specified Display Width in R Programming - strtrim() Function
- Getting String Representation of the given Date and Time Object in R Programming - strftime() Function
- Convert a String into Date Format in R Programming - as.Date() Function
- Convert an Object to a String in R Programming - toString() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.