Skip to content

Latest commit

 

History

History
57 lines (50 loc) · 2.65 KB

StyleAndConventions.md

File metadata and controls

57 lines (50 loc) · 2.65 KB

Package Style and Conventions

Useful notes on creating an R package

Style

Goal: common style among all functions within the package. Solution: Use Hadley Wickham's guide http://r-pkgs.had.co.nz/style.html

When calling a function from a different package, make sure to explicitly define the package (e.g. dplyr::summarize).

Function names

Most of these functions are introduced in a paper and that is how they are typically referred to in the literature (e.g. the Hunt solution). We will follow that convention for function names.

Variables

Use these variable names, which are consistent with the hydrogeological literature:

  • Qw = well pumping rate [L3/T] = Qf/Qs
  • Qf = capture fraction [-] = Qw/Qs
  • Qs = streamflow depletion [L3/T], = Qw*Qf
  • Qa = ambient groundwater inflow rate per unit length of stream [L2/T]
  • d = distance from well to stream [L]
  • S = aquifer storage coefficient [-] (specific yield for unconfined aquifer, storativity for confined aquifer)
  • Kh = aquifer horizontal hydraulic conductivity [L/T]
  • Kv = aquifer vertical hydraulic conductivity [L/T]
  • b = aquifer saturated thickness [L]
  • Tr = aquifer transmissivity [L2/T], = Kh*b
  • t = time since pumping started [T]
  • Kriv = riverbed hydraulic conductivity [L/T]
  • briv = thickness of riverbed semipervious layer [L]
  • w = stream width [L]
  • beff = effective transmissivity [L]. Reeves et al. (2009) use the distance from bottom of stream to top of well screen
  • lmda = streambed conductance [L/T]

Prepping for release

  • Check on local machine: devtools::check()
  • Check on CRAN win-builder, devel version: devtools::check_win_devel()
  • Check on CRAN win-builder, release version: devtools::check_win_release()
  • Check on R-hub defaults: devtools::check_rhub()
  • Update cran-comments.md and NEWS.md
  • Release: devtools::release()