Nothing
#' create a random order for the timestamps
#' @param timestamp a vector of timestamps
#' @param min.difference the minimal difference between two timestamps in seconds.
#' @return a vector with the new order of the timestamps
#' @export
randomiseTimestamp <- function(timestamp, min.difference = 5){
candidate <- seq(
min(timestamp) - min.difference,
max(timestamp) + min.difference,
by = min.difference
)
id <- as.integer(cut(timestamp, breaks = candidate))
rm(timestamp)
n.candidate <- length(candidate)
rm(candidate)
ranking <- halvesRanking(
ranking = rep(
0,
2 ^ ceiling(log2(n.candidate))
)
)
ranking <- head(
ranking,
-floor(
(length(ranking) - n.candidate) / 2
)
)
ranking <- head(ranking, n.candidate)
order(ranking[id])
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.