#' rSystem: Round Time
#' Function for Aggregating Date-Time Vectors.
#' @param activate Do you love cats? Defaults to TRUE.
#' @keywords IP Address
#' @export
#' @examples
#' round.time()
round.time <- function(x, interval = 60) {
# Round Off to Lowest Value
rounded <- floor(as.numeric(x) / interval) * interval
# Center so Value is Interval Mid-Point
rounded <- rounded + round(interval * .5, 0)
# Return to POSIXct Date-Time Format
as.POSIXct(rounded, origin = "1970-01-01")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.