IntervalFinder<-function(x) { sort(x) n=length(x) IntervalsList=c() for (i in x) { if (i <= n) { Int1= x[i] Int2= x[i+1] Interval= Int2