View source: R/convertToEgret.R
convertToEgret | R Documentation |
Convert DataForEver output to EGRET-compatible input
convertToEgret(
stn,
target_analyte,
wq_data = NULL,
flow_data = NULL,
qConvert = 1,
interact = FALSE,
paStart = 10,
paLong = 12,
watershedKm = 1,
removeNegativeFlow = TRUE
)
stn |
target station. Not case-sensitive. |
target_analyte |
Water quality parameter of interest. Internally converted to R-friendly form (no commas, hyphens, spaces). |
wq_data |
water quality dataframe. Product of |
flow_data |
flow dataframe. Product of |
qConvert |
a conversion factor applied to the flow data. Default is 1 (no conversion). Use 1/0.0283168 to convert cfs to cubic meters per second. |
interact |
logical Option for interactive mode. If true, there is user interaction for error handling and data checks. FALSE by default |
paStart |
Starting month of period of analysis. Defaults to 10. Used in most EGRET functions |
paLong |
Length in number of months of period of analysis. Defaults to 12. Used in most EGRET functions |
watershedKm |
Watershed area in km2, used to calculate runoff. Defaults to 1 |
removeNegativeFlow |
logical, defaults to TRUE. Indicates whether negative flow data should be removed during pre-processing. EGRET tools do not accommodate negative flows. |
a list as created by mergeReport
targStn <- "S333"
targAnalyte <- "PHOSPHATE, TOTAL AS P"
### subsetting occurs inside the function, so this prep is not necessary
# wq_dat <- wqDat[(wqDat$station %in% targStn) & (wqDat$param %in% targAnalyte), ]
# flow_dat <- hydDat[hydDat$station %in% targStn, ]
## Not run: # 20190404: this example causes Appveyor to fail
eList <- convertToEgret(stn = targStn, target_analyte = targAnalyte,
wq_data = wqDat, flow_data = hydDat)
eList_NA <- convertToEgret(stn = targStn, target_analyte = targAnalyte,
wq_data = wqDat, flow_data = NA)
est <- modelEstimation(eList)
est_woFlow <- modelEstimation(eList_NA)
### not quite the same
plotConcPred(est)
plotConcPred(est_woFlow)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.