This function aggregates the results stored on a daily basis in the Daily data frame and stores the average values of these in the new data frame called AnnualResults. Note that the flux values are rates (kg/day) and not a mass (kg). The "annual values" can be a full 12 months, or they can be shorter. See manual to understand paLong and paStart arguments. The simplest case, a Water Year (October through September), would have paLong=12, and paStart=10. A calendar year would be paLong=12 and paStart=1. A winter season of Dec, Jan, Feb would be paLong=3 and paStart=12

`setupYears(localDaily, paLong = 12, paStart = 10)`

A data frame 'AnnualResults' of numeric values with the following columns

Name | Description | DecYear |

Middle of the period in decimal years | Q | Mean discharge, in m^3/s |

Conc | Estimated mean concentration, in mg/L | Flux |

Estimated mean flux, in kg/day | FNConc | Flow-normalized concentration, in mg/L |

FNFlux | Flow-normalized flux, in kg/day | GenConc |

Generalized mean concentration, in mg/L. This column is only returned if the WRTDSKalman function was run, which gives the eList$Daily data frame a column "GenConc". | GenFlux | Generalized mean flux, in kg/day. This column is only returned if the WRTDSKalman function was run, which gives the eList$Daily data frame a column "GenFlux". |

PeriodLong | Length of period of analysis (paLong), in months | PeriodStart |

- localDaily
data frame containing the daily values, default is Daily

- paLong
numeric integer specifying the length of the period of analysis, in months, 1<=paLong<=12, default is 12

- paStart
numeric integer specifying the starting month for the period of analysis, 1<=paStart<=12, default is 10

```
eList <- Choptank_eList
Daily <- getDaily(eList)
AnnualResults <- setupYears(Daily, 4, 10)
```

Run the code above in your browser using DataLab