R/match.position.R

match.position <-
function(vector.match, pos, position = TRUE){
	v = order(vector.match, decreasing = TRUE)
	if (position){
		return(v[pos])
	} else {
		return(vector.match[v][pos])
	}
}

rand.order = function(vector){
	rand = runif(length(vector))
	return(vector[order(rand)])
}
dustinfife/witness documentation built on May 15, 2019, 6:05 p.m.