Repository navigation
Update documentation in package and on GitLab - #256
Conversation
|
📖 pkgdown preview for this PR: https://doi-usgs.github.io/loadflex/preview/pr256/ |
There was a problem hiding this comment.
In line 25, do you want to point to the new WDFN page (https://waterdata.usgs.gov/monitoring-location/USGS-01073500)?
There was a problem hiding this comment.
sure do, thanks!
There was a problem hiding this comment.
In line 121 ... "flux" is a rate of transport by definition, so saying "flux rate" is redundant. That being said, a lot of people don't understand what flux is, so it may not hurt to be redundant.
There was a problem hiding this comment.
Oof, good point, that's redundant. In fact, Wikipedia defines flux as a rate per unit area, so the flux/load units we use across loadflex and rloadest are also treating area implicitly (there's a hidden per-cross-section-area).
I don't want to change the column name right away because I'll need to think about what the right switch is and how to support users who may have workflows expecting the current naming scheme, but I could do that in the future.
In the meantime, I've added an explanation of the current naming scheme and an example of how to see what units are being reported:
The
loadflexprocess for aggregation of point predictions (to monthly, annual, etc.)
has changed since we published our 2015 manuscript.
aggregateSolutefrom that manuscript is no longer exported as a function in loadflex.
Instead, you can use theagg.byargument topredictSoluteto
generate predictions at the time interval of interest.
You can aggregate for for months, water years, calendar years, or other time intervals,
and for mean concentration (namedconcin the output)
or flux (flux.ratein the output, using "rate" to remind users that the time denominator
does not change regardless of the time period being aggregated over).
Standard errors (se.fitandse.pred) are available forloadReg2models.
The units of the aggregated output are what you passed into each model as metadata.
countreports the number of observations going into the aggregated estimate in each row.
Some examples:
getUnits(getMetadata(no3_lr), 'conc')
agg_c_li <- predictSolute(no3_li, "conc", newdata=estdat, agg.by="month")
agg_c_lm <- predictSolute(no3_lm, "conc", newdata=estdat, agg.by="water year")
agg_c_lr <- predictSolute(no3_lr, "conc", newdata=estdat, agg.by="unit", se.fit=TRUE, se.pred=TRUE)
agg_c_lc <- predictSolute(no3_lc, "conc", newdata=estdat, agg.by="day")
getUnits(getMetadata(no3_lr), 'flux rate')
agg_f_li <- predictSolute(no3_li, "flux", newdata=estdat, agg.by="month")
agg_f_lm <- predictSolute(no3_lm, "flux", newdata=estdat, agg.by="water year")
agg_f_lr <- predictSolute(no3_lr, "flux", newdata=estdat, agg.by="calendar year", se.fit=TRUE, se.pred=TRUE)
agg_f_lc <- predictSolute(no3_lc, "flux", newdata=estdat, agg.by="day")
gfkltn
left a comment
There was a problem hiding this comment.
I have added two comments, neither of which are critical. I saw no issues from an administrative review standpoint.
This PR is focused on getting the loadflex documentation updated (e.g., new URLs) and back on GitHub pages (now using pkgdown).
This PR includes a preview of the restored github.io pages for this package, which have been down for years! See https://doi-usgs.github.io/loadflex/preview/pr256/ for the preview while this PR is still open, and after merge we should see the pages at https://doi-usgs.github.io/loadflex.
@gfkltn, would you be able to provide the administrative review? On top of the previous two, this PR gets us to a much more functional state than we were last week, including smoother installation, fewer runtime errors/warnings, and updated documentation within the package and on the web - thank you for the prod, and I hope it's useful for you and your students.
What I did for this PR:
devtools::build_readme()and other autobuild tools know where to find the custom USGS packages. Rundevtools::build_readme()to align README.md to the current README.Rmddevtools::build_readme()could install from the specified remotes; also installed that PAT for GitHub actions use in the DOI-USGS/loadflex repo: Settings → Secrets and variables → Actions → "New repository secret."usethis::use_pkgdown()andusethis::use_pkgdown_github_pages()I worked with DOI-Claude on this all day, asking for explanations and GitHub workflow code. I did a fair amount of the actual code editing myself everywhere else in the package, following Claude's advice and logic. I considered every suggestion first, ran tests, and paid attention to test output.