Hi, for example I have two list:
nombreL <- c("Alvaro Perez", "Sebastián García", "Luis Gomez", "Jorge
Rial", "Ronaldo Apud",..., "Ana María Bianco")
nombreC <- c("Alvaro",..., "Ana",...,"Jorge",...,"Ronaldo", "Sebastian",...)
and my code is:
cuenta <- 0
topL <- length(nombreL)
topC <- length(nombreC)
for (i in 1:topL) {
for (j in 1:topC) {
k <-
grep(noquote(nombreL[i]),nombreC[j])
if (length(k) > 0){
cuenta <- cuenta + 1
}
}
Thanks,
Sebastian.
______________________________________________
[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
and provide commented, minimal, self-contained, reproducible code.