R/ftinit.R

Defines functions ftinit

Documented in ftinit

#' Function to find a time step on which the model simulation is to be initialised
#' 
#' Returns the time indes to use for initialisation
#' 
#' @param X and xts object with column names output
#' @param mdl data.frame describing the model, must contain the variable lag
#' 
#' @keywords FloorForT
#' @export
#' @examples
#' # Not Run
#' # ModelBuild()
ftinit <- function(X,mdl){
    tmp <- X[,'output']
    tmp[1:(mdl[1,'lag']-1)] <- NA
    t0 <- max( match(TRUE,is.finite(tmp)) ,mdl[1,'lag'] )
    t0 <- index(X[t0,])
    return(t0)
}
waternumbers/FloodForT documentation built on Nov. 5, 2019, 12:07 p.m.