Skip to content
Prev 318801 / 398521 Next

Function completely locks up my computer if the input is too big

I see you have profiling calls in there.  Have you used them?

It is often fruitful to see how the time for a function grows as size of the input or output grows.  Have you tried that? 

A concrete suggestion is to change
   for(i in 1:n){
      if(is.na(or.deg[i])==TRUE) {or.deg[i] <- 0}
   }
to
     or.deg[is.na(or.deg)] <- 0

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com