Hi, The loop 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. -- View this message in context: http://www.nabble.com/stalled-loop-tf4451301.html#a12699524 Sent from the R help mailing list archive at Nabble.com.
You will have to supply a lot more information than you have. Is it a memory problem (are you paging), is it a function of your data structure, is it your algorithm, etc. Please follow the guidelines: "provide commented, minimal, self-contained, reproducible code." On 9/16/07, kevinchang <shukai at seas.upenn.edu> wrote:> > Hi, > > The loop 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. > -- > View this message in context: http://www.nabble.com/stalled-loop-tf4451301.html#a12699524 > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve?
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.