On Oct 25, 2009, at 10:17 PM, Paul Galpern wrote:

I am sure there is something I am just not understanding about agrep functionality.
str1 <- c("ab","aba","abc")
agrep("abc",str1, max.distance = list(insertions=0, substitutions=0, deletions=1), value=T)

returns:
[1] "ab"  "aba" "abc"

Why is "aba" a match?

The help page says that the parameters apply to the pattern, not the arguments.

 "ab" matches all of the offered arguments.

It seems to me that this should require a substitution and this has been set to 0 in max.distance. Alternatively this would require a deletion plus an insertion but, again, not permitted in arguments.

Thanks for your help,

Paul Galpern
PhD Candidate
--

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to