Dimitris Rizopoulos wrote:
try this:

match.pat <- function (mat, target, nomatch = -1) {
   f1 <- do.call("paste", c(as.data.frame(mat), sep = "\r"))
   f2 <- paste(target, collapse = "\r")
   ind <- f1 %in% f2
   if (any(ind)) which(ind)[1] else nomatch
}

Thanks! More R for me to sink my teeth in :-)  My own solution
doesn't seem to work quite correctly as I found out from some
further testing .. so the solutions posted here are much appreciated!

Esmail

______________________________________________
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