R/makepredictcall.R

Defines functions makepredictcall.trends

Documented in makepredictcall.trends

#' Utility Function for Safe Prediction
#' 
#' Creates the right matrices for \code{\link{model.frame.default}} 
#'when predicting from models with \code{trends} terms. Used only internally.
#' 
#' @rdname makepredictcall
#' @param var a variable.
#' @param call the term in the formula, as a call.
#' @return A replacement for \code{call} for the prediction variable.
#' @importFrom stats makepredictcall
#' @export
#' @method makepredictcall trends
makepredictcall.trends <- function(var, call) {
	# Coding history:
	#    2013Aug15 DLLorenz Original coding
	#    2014Dec22 DLLorenz Roxygen header
	#
  if (as.character(call)[1L] != "trends") 
    return(call)
  call$breaks <- attr(var, "breaks")
  call$boundary.breaks <- c(TRUE, TRUE) 
  return(call)
}
USGS-R/smwrStats documentation built on Oct. 11, 2022, 6:15 a.m.