MatchesIndices(HFWutils)R Documentation

provides boolean vectors where matches were found

Description

returns indices whether patterns were matched succesfully in a character vector

Usage

MatchesIndices(x, patt,fixed=FALSE)

Arguments

x ~~Describe x here~~
patt ~~Describe patt here~~
fixed ~~Describe fixed here~~

Details

returns two indices one correspoding to the character vector, abnother to the patterns

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]+'
        MatchesIndices (Vector,patt)
        #  $index_x
        #  sum(F17:G18)+G190*G2+ sum(A1:B2) 
        #                              TRUE 
        #  
        #  $index_patt
        #  [A-F]+[0-9]+ 
        #  TRUE        
        
        # Example 2
        MatchesIndices (c(Vector, "sum(A1:B2)"),patt)
                 
        #      $index_x
        #      sum(F17:G18)+G190*G2+ sum(A1:B2)                       sum(A1:B2) 
        #                                  TRUE                             TRUE 
        #      
        #      $index_patt
        #      [A-F]+[0-9]+ 
        #              TRUE 
        
        
        
        # Example 3
        MatchesIndices (x =c("Patrick Pasot, Patrick Schmidt","Patrick Denker"),
                        patt   =c("Patrick","Schmidt")
                        ) # Matches
        #       $index_x
        #       Patrick Pasot, Patrick Schmidt                 Patrick Denker 
        #                                 TRUE                           TRUE 
        #       
        #       $index_patt
        #       Patrick Schmidt 
        #          TRUE    TRUE 


        # Example 4
        out <-   MatchesIndices (x =c("Patrick Pasot, Patrick Schmidt","Patrick Denker"),
                          patt   =c("Pat[a-z]+")
                           ) # Matches
        
        out
        #       $index_x
        #       Patrick Pasot, Patrick Schmidt                 Patrick Denker 
        #                                 TRUE                           TRUE 
        #       
        #       $index_patt
        #       Pat[a-z]+ 
        #            TRUE 

[Package HFWutils version 0.7.2007.09.02 Index]