#' posixchange
#'
#' An easy function for calculating the total seconds of a time frame in dd:hh:mm:ss format
#' @param time_frame Your time object - could be a vector or a column (or columns) from a data frame
#' @export
posixchange <- function(time_frame) {
time_frame <- as.character(time_frame)
time_frame <- str_split(time_frame,fixed(":")) #split the time into elements
time_frame <- time_frame[[1]] #convert from list to vector
days <- as.numeric(time_frame[[1]])
hours <- as.numeric(time_frame[[2]])
minutes <- as.numeric(time_frame[[3]])
seconds <- as.numeric(time_frame[[4]])
z <- (days * 86400) + (hours * 3600) + (minutes * 60) + seconds
return(z)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.