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)])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.