R/topidx.classes.R

topidx.classes <- function(array, n) {
	array<-array[!is.na(array)]
	breaks<-seq(min(array),max(array), len=n)
	interval<-findInterval(array,breaks,rightmost.closed=T)
	counts<-tabulate(interval)
	counts<-counts[order(breaks[2:n], decreasing=T)]
	breaks<-breaks[order(breaks, decreasing=T)]
	counts<-counts/sum(counts)
	return(data.matrix(cbind(breaks,c(0,counts))))
}

Try the RHydro package in your browser

Any scripts or data that you put into this service are public.

RHydro documentation built on May 2, 2019, 6:24 p.m.