R/setDefaults.R

Defines functions setDefaults

Documented in setDefaults

#' Default Values
#' 
#' Sets the default values for plot control lists (support function).
#' 
#' 
#' @param current the control parameters specified in the call to the
#' high-level graphing function.
#' @param \dots the default values for each name required for the control
#' parameters.
#' @return The control parameters with defaults substituted for missing names.
#' @keywords dplot
#' @export setDefaults
setDefaults <- function(current=list(), ...) {
	# Coding History:
	#    2011Jun21 DLLorenz Original coding
	#    2014Jun26 DLLorenz Converted to roxygen
	#
  dots <- list(...)
  for(i in names(dots))
    if(is.null(current[[i]]))
      current[[i]] <- dots[[i]]
  return(current)
}
USGS-R/smwrGraphs documentation built on Oct. 11, 2022, 6:11 a.m.