[R] problem with pattern matching

David Winsemius dwinsemius at comcast.net
Wed Aug 5 00:18:46 CEST 2009


On Aug 4, 2009, at 11:16 AM, Rnewbie wrote:

>
> dear all,
>
> I got a problem with pattern matching using grep. I extracted a list  
> of
> characters from a data frame, and I tried to match this list of  
> characters
> to a column from another data frame. In return, I got only one  
> match, but
> there should be far more matches. Any ideas what has gone wrong?

In general this falls into the category of  a request to "read my  
mind". One, out of probably an infinite number, of ways to get such a  
result is to use if()  when you needed ifelse().

>
> Another question, if I also want to match the whole of the elements  
> against
> the non-initial parts of the elements in another table. Which  
> command should
> I use?

Cannot even assign a semantic meaning to that one. What is are "non- 
initial parts of the elements of another table"?


******************************************************************
>  .... provide commented, minimal, self-contained, reproducible code.
******************************************************************
>
> Thanks

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list