Gabor Grothendieck <ggrothendieck <at> gmail.com> writes:

> 
> We could use sapply to reduce it slightly:
> 
> result <- sapply(sprintf("\\%d", 1:2), sub, pattern = pat, x = patid)
> result[regexpr(pat, patid) < 0,] <- NA
> 

Looks like we should make a generalized wrapper for it.

Dieter

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to