distributeMean: Distribute mean values

View source: R/distributeMean.R

distributeMeanR Documentation

Distribute mean values

Description

Distributes mean values to a shorter time interval. The missing datetimes are inserted and then the values are repeated. This function is typically used to downscale obs values such as t, ea, and u.

Usage

distributeMean(
  obs,
  obsCols = "all",
  timeStep = 0,
  maxLength = 5,
  quiet = TRUE,
  logfile = ""
)

Arguments

obs

Required. The CRHMr data frame of obs values.

obsCols

Optional. A vector containing the columns to be imputed in the obs data frame, not including the datetime. The default all specifies all columns.

timeStep

Required. The time step (in hours) for the interpolated values. This value must be smaller than the time step in the original time series.

maxLength

Optional. The maximum gap length to be interpolated. Defaults to 5 time steps.

quiet

Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave quiet=TRUE (i.e. the default). If you are working interactively, you will probably want to set quiet=FALSE.

logfile

Optional. Name of the file to be used for logging the action. Normally not use

Value

If successful, returns a dataframe of the selected columns interpolated to the specified time step. If unsuccessful, returns an error.

Author(s)

Kevin Shook

See Also

distributeInst

Examples

## Not run: 
hourly_vals <- distributeMean(vegreville, c(1,2,3), timeStep = 1)
## End(Not run)

CentreForHydrology/CRHMr documentation built on April 6, 2024, 5:27 p.m.