#' @importFrom plyr round_any
round_rand = function(x, accuracy = 1) {
prob = (x - plyr::round_any(x, accuracy, f = floor)) / accuracy
return(ifelse(runif(length(x)) < prob,
plyr::round_any(x, accuracy, f = ceiling),
plyr::round_any(x, accuracy, f = floor)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.