Matches(HFWutils)R Documentation

string and patterns matching in character Vector

Description

perform string and patterns matching in character Vector

Usage

Matches(Vector, patt, fixed = FALSE)

Arguments

Vector ~~Describe Vector here~~
patt ~~Describe patt here~~
fixed ~~Describe fixed here~~

Details

result is returned as a matrix

Value

~Describe the value returned If it is a LIST, use

comp1 Description of 'comp1'
comp2 Description of 'comp2'

...

Note

~~further notes~~

Author(s)

Felix Wittmann hfwittmann@gmail.com

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples


        # 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"


[Package HFWutils version 0.7.2007.09.02 Index]