R/trunc.r

#' trunc_seconds
#' 
#' Returns a function that truncates POSIXct times to start of nearest interval
#'
#' @param	n 		interval length, in seconds
#' @export
trunc_seconds <- function(n) {
	function(x) as.POSIXct(x - as.numeric(x) %% n)
}
holstius/opentsdbr documentation built on May 17, 2019, 4:50 p.m.