#' fills DateTime gaps in a timeseries and fills the according values with NA.
#'
#' @param file a data frame, matrix or array containing one column with POSIXct formated DateTime objects
#' @param timestep string, time interval of the input timeseries. Example: "1 min", "10 min", "1 hour"
#' @return returns the file with complete timeseries.
#' @export
fillNA_datesequence <- function(file, timestep)
{
b <- sapply(file, is.POSIXct)
c <- unname(which(b == TRUE))
Time_column <- names(file)[c]
DateTime <- seq(min(file[, c]), max(file[, c]), by = timestep)
time_sequence <- as.data.frame(DateTime)
file <- merge(time_sequence, file, by.x = "DateTime", by.y = Time_column, all.x = TRUE)
return(file)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.