Hey everyone, The code I wrote executes correctly but is stalled seriously. Is there a way to hasten execution without coming up with a brand new algorithm ?please help. Thanks a lot for your time.
#a simplified version of the code a<-c("superman" , "xman" , "spiderman" ,"wolfman" ,"mansuper","manspider" ) b<-sapply(a,function(.srt){paste(sort(strsplit(.srt,'')[[1]]), collapse="")}) c<-NA for(i in 1:length(b)) { if(length(which(b==b[i]))>1) c[i]<-b[i] } c<-c[!is.na(c)] # But if my get the volumne of "a" up to about 150000 words , the loop will work incredibly slowly. -- View this message in context: http://www.nabble.com/stalled-loop-tf4456879.html#a12708590 Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.