[Rd] Pb with agrep()

From: Herve Pages <hpages_at_fhcrc.org>
Date: Thu 05 Jan 2006 - 01:29:35 GMT


Happy new year everybody,

I'm getting the following while trying to use the agrep() function:

> pattern <- "XXX"
> subject <- c("oooooo", "oooXooo", "oooXXooo", "oooXXXooo")
> max <- list(ins=0, del=0, sub=0) # I want exact matches only
> agrep(pattern, subject, max=max)

[1] 4

OK

> max$sub <- 1 # One allowed substitution
> agrep(pattern, subject, max=max)

[1] 3 4

OK

> max$sub <- 2 # Two allowed substitutions
> agrep(pattern, subject, max=max)

[1] 3 4

Wrong!

> sessionInfo()

R version 2.3.0, 2005-12-22, x86_64-unknown-linux-gnu  

attached base packages:
[1] "methods" "stats" "graphics" "grDevices" "utils" "datasets" [7] "base"  

other attached packages:
Biostrings

   "1.5.6"

Cheers,

Hervé

-- 
------------------------
Hervé Pagès
E-mail: hpages@fhcrc.org
Phone: (206) 667-5791
Fax: (206) 667-1319

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu Jan 05 12:34:15 2006

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:35 GMT