Matches(HFWutils) | R Documentation |
perform string and patterns matching in character Vector
Matches(Vector, patt, fixed = FALSE)
Vector |
~~Describe Vector here~~ |
patt |
~~Describe patt here~~ |
fixed |
~~Describe fixed here~~ |
result is returned as a matrix
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
~~further notes~~
Felix Wittmann hfwittmann@gmail.com
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
# Example 1 Vector <- "sum(F17:G18)+G190*G2+ sum(A1:B2)" patt <- '[A-F]+[0-9]+' Matches (Vector,patt) # [A-F]+[0-9]+ # sum(F17:G18)+G190*G2+ sum(A1:B2) Character,3 # Example 2 Matches (c(Vector, "sum(A1:B2)"),patt) # [A-F]+[0-9]+ # sum(F17:G18)+G190*G2+ sum(A1:B2) Character,3 # sum(A1:B2) Character,2 # Example 3 Matches (Vector =c("Patrick Pasot, Patrick Schmidt","Patrick Denker"), patt =c("Patrick","Schmidt") ) # Matches # Patrick Schmidt #Patrick Pasot, Patrick Schmidt Character,2 "Schmidt" #Patrick Denker "Patrick" Character,0 # Example 4 out <- Matches (Vector =c("Patrof Pasot, Patrum Schmidt","Pater Denker"), patt =c("Pat[a-z]+") ) # Matches out # Pat[a-z]+ #Patrof Pasot, Patrum Schmidt Character,2 #Pater Denker "Pater" v out[1,1][[1]] #[1] "Patrof" "Patrum"