stitch: stitch surfaces

View source: R/stitch.R

stitchR Documentation

stitch surfaces

Description

This function creates a continuous surfaces object that starts just before surfaceStart and ends just after surfaceEnd. It is made up from two surfaces objects created when there is a wall specified for the analysis. The first surfaces object is based on data prior to the wall and the second surfaces object is based on data after the wall. The wall is located just after sample1EndDate. The Daily data frame is used only to set the minimum and maximum discharges used to construct the indices for discharges in the surfaces.

Usage

stitch(eList, sample1StartDate, sample1EndDate, sample2StartDate,
  sample2EndDate, surfaceStart = NA, surfaceEnd = NA, minNumObs = 100,
  minNumUncen = 50, fractMin = 0.75, windowY = 7, windowQ = 2,
  windowS = 0.5, edgeAdjust = TRUE, verbose = FALSE,
  run.parallel = FALSE)

Arguments

eList

named list with at least the Daily, Sample, and INFO dataframes

sample1StartDate

The Date (or character in YYYY-MM-DD) of the first sample to be used in estimating the first segment of the surfaces object.

sample1EndDate

The Date (or character in YYYY-MM-DD) of the last sample to be used in the first segment of the surfaces object.

sample2StartDate

The Date (or character in YYYY-MM-DD) of the first sample to be used in the second segment of the surfaces object.

sample2EndDate

The Date (or character in YYYY-MM-DD) of the last sample to be used in the second segment of the surfaces object.

surfaceStart

The Date (or character in YYYY-MM-DD) that is the start of the WRTDS model to be estimated and the first of the daily outputs to be generated. Default is NA, which means that the surfaceStart is based on the date of the first sample.

surfaceEnd

The Date (or character in YYYY-MM-DD) that is the end of the WRTDS model to be estimated and the last of the daily outputs to be generated. Default is NA, which means that the surfaceEnd is based on the date of the last sample.

minNumObs

numeric specifying the miniumum number of observations required to run the weighted regression, default is 100

minNumUncen

numeric specifying the minimum number of uncensored observations to run the weighted regression, default is 50

fractMin

numeric specifying the minimum fraction of the observations required to run the weighted regression, default is 0.75. The minimum number will be the maximum of minNumObs and fractMin multiplied by total number of observations.

windowY

numeric specifying the half-window width in the time dimension, in units of years, default is 7

windowQ

numeric specifying the half-window width in the discharge dimension, units are natural log units, default is 2

windowS

numeric specifying the half-window with in the seasonal dimension, in units of years, default is 0.5

edgeAdjust

logical specifying whether to use the modified method for calculating the windows at the edge of the record. The edgeAdjust method tends to reduce curvature near the start and end of record. Default is TRUE.

verbose

logical specifying whether or not to display progress message

run.parallel

logical to run bootstrapping in parallel or not

Examples

eList <- Choptank_eList

surfaceStart <- "1986-10-01"
surfaceEnd <- "2010-09-30"

# Surface skips a few years:
sample1StartDate <- "1986-10-01"
sample1EndDate <- "1992-09-30"
sample2StartDate <- "1996-10-01"
sample2EndDate <- "2011-09-30"


surface_skip <- stitch(eList, 
                         sample1StartDate, sample1EndDate, 
                         sample2StartDate, sample2EndDate,
                         surfaceStart, surfaceEnd)

# Surface overlaps a few years:
sample1StartDate <- "1986-10-01"
sample1EndDate <- "1996-09-30"
sample2StartDate <- "1992-10-01"
sample2EndDate <- "2011-09-30"

surface_overlap <- stitch(eList, 
                         sample1StartDate, sample1EndDate, 
                         sample2StartDate, sample2EndDate)


EGRET documentation built on April 18, 2023, 5:09 p.m.