R/CreateData.R
CreateData.Rd
Creates a regularised flow dataset for prediction and a modelling dataset with flow metrics that can be used in regression modelling.
n x 2
matrix of flow (Date, Flow) where flow is measured in cumecs
$nxp$ matrix of concentrations (Date, Conc1, Conc2, ...) where concentration is measured in mg/L
list containing date ranges for modelling and prediction datasets (default: NULL)
sampling unit 'hour' or 'daily'
water year "WY" or "WY2" or financial year "FY" (note only WY implemented at this stage)
Qflush
Regularisation check
a list
of class 'regdata' containing:
CQ
flow and concentration modelling dataset
Qreg
regularised dataset
Q
Observed flow matrix
Standard summary
and plot
functions apply.
CreateData
This function creates two datasets that are used in modelling and prediction. A third dataset is just a copy of the observed flow data.
Inputs into the function are flow and concentration datasets that
have been read in using the ReadInData
function or
are of class "data".
Kuhnert, P.M., Henderson, B.L., Lewis, S.E., Bainbridge, Z.T., Wilkinson, S.N. and Brodie, J.E. (2012) Quantifying total suspended sediment export from the Burdekin River catchment using the loads regression estimator tool, Water Resources Research, 48, W04533,doi:10.1029/2011WR011080.
ReadInData
#Reading in data already stored in R
library(LRE)
burdR <- ReadInDataFromR(x.C = burdRC, x.Q = burdRQ)
# Create Dataset (no need for regularisation here as have full data)
date.rangeM <- c("1973-12-02", "2015-06-30")
date.rangeP <- c("1973-12-02", "2015-06-30")
loaddata <- CreateData(Q = burdR$Q, Conc = burdR$Conc,
date.range = list(model = date.rangeM, pred = date.rangeP, hour = FALSE),
samp.unit = "day", Ytype = "WY", Qflush = 0.9,
Reg = list(type = "none", rainfall = NULL, date = NULL))
p <- plot(loaddata, Type = "WY")
#> `geom_smooth()` using formula = 'y ~ x'
summary(loaddata)
#> Bias in flow and concentration sampling:
#> Year n AvgFlowC AvgFlowR AvgFlowO FlowC.bias FlowQ.bias
#> 1 1973/1974 NA NA 2057.60410 2057.60410 NA 1
#> 2 1974/1975 NA NA 264.52109 264.52109 NA 1
#> 3 1975/1976 NA NA 374.91938 374.91938 NA 1
#> 4 1976/1977 NA NA 272.58740 272.58740 NA 1
#> 5 1977/1978 NA NA 165.90277 165.90277 NA 1
#> 6 1978/1979 NA NA 493.41670 493.41670 NA 1
#> 7 1979/1980 NA NA 145.24868 145.24868 NA 1
#> 8 1980/1981 NA NA 575.67087 575.67087 NA 1
#> 9 1981/1982 NA NA 67.75941 67.75941 NA 1
#> 10 1982/1983 NA NA 280.63198 280.63198 NA 1
#> 11 1983/1984 NA NA 170.57724 170.57724 NA 1
#> 12 1984/1985 NA NA 38.01298 38.01298 NA 1
#> 13 1985/1986 NA NA 119.32072 119.32072 NA 1
#> 14 1986/1987 NA NA 20.82907 20.82907 NA 1
#> 15 1987/1988 NA NA 125.83615 125.83615 NA 1
#> 16 1988/1989 NA NA 291.20616 291.20616 NA 1
#> 17 1989/1990 NA NA 296.43897 296.43897 NA 1
#> 18 1990/1991 NA NA 1277.56067 1277.56067 NA 1
#> 19 1991/1992 NA NA 16.77969 16.77969 NA 1
#> 20 1992/1993 NA NA 17.58636 17.58636 NA 1
#> 21 1993/1994 NA NA 92.83138 92.83138 NA 1
#> 22 1994/1995 NA NA 24.56647 24.56647 NA 1
#> 23 1995/1996 NA NA 68.40040 68.40040 NA 1
#> 24 1996/1997 NA NA 275.21871 275.21871 NA 1
#> 25 1997/1998 NA NA 286.82611 286.82611 NA 1
#> 26 1998/1999 NA NA 190.50413 190.50413 NA 1
#> 27 1999/2000 NA NA 437.95500 437.95500 NA 1
#> 28 2000/2001 NA NA 277.96023 277.96023 NA 1
#> 29 2001/2002 NA NA 142.22841 142.22841 NA 1
#> 30 2002/2003 NA NA 66.36333 66.36333 NA 1
#> 31 2003/2004 NA NA 47.94674 47.94674 NA 1
#> 32 2004/2005 NA NA 137.24775 137.24775 NA 1
#> 33 2005/2006 14 824.3909 69.75343 69.75343 11.818643 1
#> 34 2006/2007 20 3633.2679 309.77088 309.77088 11.728888 1
#> 35 2007/2008 47 4513.8394 869.72241 869.72241 5.189977 1
#> 36 2008/2009 44 5459.2125 930.75820 930.75820 5.865339 1
#> 37 2009/2010 40 1335.2939 251.97980 251.97980 5.299210 1
#> 38 2010/2011 94 2654.2267 1104.36741 1104.36741 2.403391 1
#> 39 2011/2012 53 151.2060 82.44307 82.44307 1.834066 1
#> 40 2012/2013 24 578.1959 108.83642 108.83642 5.312522 1
#> 41 2013/2014 25 128.4263 46.64155 46.64155 2.753474 1
#> 42 2014/2015 16 147.4887 32.15938 32.15938 4.586180 1
#>
#>
#> Calculating quantiles from long term flow record with user defined cutoff.
#> No. of samples in the upper 2 percentile of flow: 72 (19% of samples collected)
#>
#> Distribution of flow sampling:
#> <25%ile 25%ile-50%ile 50%ile-75%ile 75%ile-90%ile 90%ile-95%ile
#> 0.27 2.39 14.06 20.42 18.04
#> 95%ile-98%ile 98%ile-99%ile >99%ile
#> 25.73 7.43 11.67