WindowsOS <- function() if(Sys.info()["sysname"] == "Windows") TRUE else FALSE
MacOSXP <- function() if(Sys.info()["sysname"] %in% c("darwin", "Darwin")) TRUE else FALSE
LinuxOS <- function() if(Sys.info()["sysname"] == "Linux") TRUE else FALSE
split_path <- function(path){
# https://stackoverflow.com/q/29214932
if (dirname(path) %in% c(".", path)) return(basename(path))
return(c(basename(path), split_path(dirname(path))))
}
time_step_3hour <- function(start_date, end_date){
start <- try(as.POSIXct(start_date, tz = "GMT"), silent = TRUE)
if(inherits(start, "try-error")) stop("Invalid start date")
end <- try(as.POSIXct(paste(end_date, "21:00:00"), tz = "GMT"), silent = TRUE)
if(inherits(end, "try-error")) stop("Invalid end date")
seq(start, end, "3 hours")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.