Hi,

Is there a faster way to do this? It takes forever, even on a  
moderately sized dataset.


n          <- dim(dsn)[1]
dsn2 <- dsn[order(-dsn$xhat),]
dsn2[1, "cumx"] <- dsn2[1, "xhat"]

for (i in 2:n) {
	dsn2[i, "cumx"] <- dsn2[i - 1, "cumx"] + dsn2[i, "xhat"]
}


	[[alternative HTML version deleted]]

