diff --git a/.gitattributes b/.gitattributes index c67f967..745304d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,34 +1,37 @@ -# https://help.github.com/articles/dealing-with-line-endings +# See https://help.github.com/articles/dealing-with-line-endings -# This setting will tell git to handle the files specified automatically. +# Auto detect text files and perform LF normalization * text=auto -# This setting tells git to always normalize the files specified. When -# committed they are stored with LF, on checkout they are converted to the OS's -# native line endings. -*.bib text -*.bst text -*.csv text -*.f text -*.inc text -*.kml text -*.md text -*.note text -*.R text -*.Rd text -*.Rmd text -*.Rnw text -*.Rprofile text -*.txt text +# Committed text files that are stored with LF and converted to native line endings on checkout. +*.bib text +*.csv text +*.f text +*.inc text +*.kml text +*.md text +*.R text +*.Rd text +*.Rmd text +*.Rnw text +*.tex text +*.txt text +*.xml text +.gitattributes text +.gitignore text +.Rbuildignore text +inst/CITATION text +DESCRIPTION text +LICENSE.note text +NAMESPACE text +NEWS text -# This setting tells git that the files specified are not text at all, and it -# should not try to change them. +# Text files that should always have LF line endings on checkout. +src/Makevars text eol=lf + +# Files that are binary and should not be modified. *.exe binary *.pdf binary *.rda binary *.tif binary *.zip binary - -# This setting tells git that the files specified should always have LF line -# endings on checkout. -Makevars text eol=lf diff --git a/DESCRIPTION b/DESCRIPTION index 853cb39..45b8516 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: wrv Type: Package Version: 1.0.3 -Date: 2016-07-05 +Date: 2016-8-12 Title: Wood River Valley Groundwater-Flow Model Author: Jason C. Fisher Maintainer: Jason C. Fisher diff --git a/R/AddInsetMap.R b/R/AddInsetMap.R index df37ca8..1dca0ea 100644 --- a/R/AddInsetMap.R +++ b/R/AddInsetMap.R @@ -24,9 +24,9 @@ AddInsetMap <- function(p, col=c("#D8D8D8", "#BFA76F"), ext <- extent(gUnion(p, b)) if (is.null(width)) { - dx <- width * (diff(usr[1:2]) / par("pin")[1]) - } else { dx <- 0.2 * diff(usr[1:2]) + } else { + dx <- width * (diff(usr[1:2]) / par("pin")[1]) } dy <- dx * (diff(ext[3:4]) / diff(ext[1:2])) diff --git a/R/UpdateWaterBudget.R b/R/UpdateWaterBudget.R index bc92ca2..d330cb9 100644 --- a/R/UpdateWaterBudget.R +++ b/R/UpdateWaterBudget.R @@ -39,7 +39,7 @@ UpdateWaterBudget <- function(dir.run, id, write.csv(wrv::efficiency, file=f, quote=FALSE, row.names=FALSE) eff <- read.csv(f) - # Read tributary underflow from calibration file + # Read tributary underflow control parameters from calibration file f <- file.path(dir.run, "trib.csv") if (!file.exists(f)) { @@ -59,7 +59,7 @@ UpdateWaterBudget <- function(dir.run, id, mult <- GetSeasonalMult(wrv::gage.disch[, c("Date", "13139510")], reduction, d.in.mv.ave, tr.stress.periods) mult <- data.frame(Date=head(tr.stress.periods, -1), - multiplier=rep(mult$multiplier, each=3)) + multiplier=rep(mult$multiplier, each=3)) # seasonal to monthly ave.flows <- wrv::tributaries$Flow names(ave.flows) <- wrv::tributaries$Name diff --git a/README.md b/README.md index 95360a8..27fd61b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ # wrv -An [R](http://www.r-project.org/ "The R Project for Statistical Computing") package for processing the groundwater-flow model of the Wood River Valley (WRV) aquifer system, south-central Idaho. -The groundwater-flow model is described in the associated [model report](http://dx.doi.org/10.3133/sir20165080 "USGS Scientific Investigations Report") and -[model archive](https://www.sciencebase.gov/catalog/item/577507c1e4b07dd077c70746 "USGS Data Release"). -Included in the package is [MODFLOW-USG](http://water.usgs.gov/ogw/mfusg/ "MODFLOW-USG") version 1.2, a U.S. Geological Survey (USGS) computer code that solves the groundwater-flow equation. -The set of standards used for coding the **wrv** package is documented in [Google's R Style Guide](https://google.github.io/styleguide/Rguide.xml "Google's R Style Guide"). +An [R](http://www.r-project.org/ "The R Project for Statistical Computing") package for processing the +groundwater-flow model of the Wood River Valley (WRV) aquifer system, south-central Idaho. +The groundwater-flow model is described in the associated +[model report](http://dx.doi.org/10.3133/sir20165080 "USGS Scientific Investigations Report") and +[model archive](http://dx.doi.org/10.5066/F7C827DT "USGS Data Release"). +Included in the package is [MODFLOW-USG](http://water.usgs.gov/ogw/mfusg/ "MODFLOW-USG") version 1.2, +a U.S. Geological Survey (USGS) computer code that solves the groundwater-flow equation. +The set of standards used for coding this package is documented in +[Google's R Style Guide](https://google.github.io/styleguide/Rguide.xml "Google's R Style Guide"). ## Install @@ -15,7 +19,7 @@ Next, open an R session and install user-contributed R packages from CRAN and th ```r repos <- c("http://owi.usgs.gov/R", getOption("repos")) -install.packages("wrv", repos = repos, dependencies = TRUE, type = "both") +install.packages("wrv", repos = repos, dependencies = TRUE) ``` ## Run @@ -38,8 +42,10 @@ Please consider reporting bugs and asking questions on the [Issues page](https:/ ## Disclaimer -This software is in the public domain because it contains materials that originally came from the USGS, an agency of the United States Department of Interior. -For more information, see the [official USGS copyright policy](http://www.usgs.gov/visual-id/credit_usgs.html#copyright/ "official USGS copyright policy"). +This software is in the public domain because it contains materials that originally came from the USGS, +an agency of the United States Department of Interior. +For more information, see the +[official USGS copyright policy](http://www.usgs.gov/visual-id/credit_usgs.html#copyright/ "official USGS copyright policy"). Although this software program has been used by the USGS, no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, diff --git a/inst/doc/sir20165080_AppendixA.R b/inst/doc/sir20165080_AppendixA.R index 89b6325..b57a7c7 100644 --- a/inst/doc/sir20165080_AppendixA.R +++ b/inst/doc/sir20165080_AppendixA.R @@ -5,7 +5,7 @@ try(knitr::opts_chunk$set(tidy=FALSE, comment="#", fig.align="center"), silent=T ## ----eval=FALSE---------------------------------------------------------- # repos <- c("http://owi.usgs.gov/R", getOption("repos")) # update.packages(ask = FALSE, repos = repos) -# install.packages("wrv", repos = repos, dependencies = TRUE, type = "both") +# install.packages("wrv", repos = repos, dependencies = TRUE) ## ----warning=FALSE, message=FALSE, results="hide"------------------------ library("wrv") diff --git a/inst/doc/sir20165080_AppendixA.Rnw b/inst/doc/sir20165080_AppendixA.Rnw index 575bfd5..5ef0a19 100644 --- a/inst/doc/sir20165080_AppendixA.Rnw +++ b/inst/doc/sir20165080_AppendixA.Rnw @@ -75,7 +75,7 @@ That is, start an \R{} session and type the following commands in your \R{}-cons <>= repos <- c("http://owi.usgs.gov/R", getOption("repos")) update.packages(ask = FALSE, repos = repos) -install.packages("wrv", repos = repos, dependencies = TRUE, type = "both") +install.packages("wrv", repos = repos, dependencies = TRUE) @ \noindent Once the packages are installed, load the \textbf{wrv} package in the current \R{} session: diff --git a/inst/extdata/README.md b/inst/extdata/README.md index 70f59a6..663b01d 100644 --- a/inst/extdata/README.md +++ b/inst/extdata/README.md @@ -5,6 +5,8 @@ processing occurs in stages, and the "processed data" from one stage may be cons Many of these datasets are composed entirely of data collected from the study site; however, a few of the datasets are the result of a preliminary stage of data processing. For example, evapotranspiration and precipitation datasets are the result of processing that is not explicitly shown in the **wrv** package. +The only unprocessed dataset used during model construction and not included under this folder is located on the +[The National Map](http://nationalmap.gov/) and represents the land surface elevation within the study area. ## File and Folder Structure diff --git a/inst/misc/readme-template.txt b/inst/misc/readme-template.txt index 54c2acd..5add339 100644 --- a/inst/misc/readme-template.txt +++ b/inst/misc/readme-template.txt @@ -222,7 +222,7 @@ repo <- "https://mran.revolutionanalytics.com/snapshot/@{packageDescription('wrv', fields = 'Date')}/" pkgs <- c($(pkgs)) - install.packages(pkgs, repos = repo, type = "both") + install.packages(pkgs, repos = repo) Install the R-package wrv from a distribution file contained within the data release. Specify the absolute path to the model archive folder diff --git a/man/AddInsetMap.Rd b/man/AddInsetMap.Rd index 90e2470..ba438ba 100644 --- a/man/AddInsetMap.Rd +++ b/man/AddInsetMap.Rd @@ -42,7 +42,7 @@ Used for the side-effect of a inset map drawn on the current graphics device. \examples{ PlotMap(alluvium.thickness@crs, bg.image = hill.shading, reg.axs = FALSE) -AddInsetMap(idaho, width = 1, main.label = list("IDAHO", adj = c(-0.4, -4.9)), +AddInsetMap(idaho, main.label = list("IDAHO", adj = c(-0.4, -4.9)), sub.label = list("Map area", adj = c(0.5, 2.5)), loc = "topright") graphics.off() diff --git a/man/UpdateWaterBudget.Rd b/man/UpdateWaterBudget.Rd index 3a3207f..ad04a27 100644 --- a/man/UpdateWaterBudget.Rd +++ b/man/UpdateWaterBudget.Rd @@ -43,8 +43,6 @@ And a binary data file \file{model.rda} containing the following serialized \R o \dQuote{lay1.top}, \dQuote{lay1.bot}, \dQuote{lay2.bot}, and \dQuote{lay3.bot}. These raster layers describe the geometry of the model grid; that is, the upper and lower elevation of model layer 1, and the bottom elevations of model layers 2 and 3. -In addition to these layers, \code{rs} includes ancillary raster layers \dQuote{lay1.zones}, \dQuote{lay2.zones}, and \dQuote{lay3.zones} -describing the distribution of hydrogeologic zones in the model grid. Missing cell values (equal to \code{NA}) indicate inactive model cells lying outside of the model domain. \code{misc} is a \code{data.frame} object with miscellaneous seepage, diff --git a/vignettes/sir20165080_AppendixA.Rnw b/vignettes/sir20165080_AppendixA.Rnw index 575bfd5..5ef0a19 100644 --- a/vignettes/sir20165080_AppendixA.Rnw +++ b/vignettes/sir20165080_AppendixA.Rnw @@ -75,7 +75,7 @@ That is, start an \R{} session and type the following commands in your \R{}-cons <>= repos <- c("http://owi.usgs.gov/R", getOption("repos")) update.packages(ask = FALSE, repos = repos) -install.packages("wrv", repos = repos, dependencies = TRUE, type = "both") +install.packages("wrv", repos = repos, dependencies = TRUE) @ \noindent Once the packages are installed, load the \textbf{wrv} package in the current \R{} session: diff --git a/vignettes/sir20165080_AppendixD.Rnw b/vignettes/sir20165080_AppendixD.Rnw index 6c32a08..fc8fb05 100644 --- a/vignettes/sir20165080_AppendixD.Rnw +++ b/vignettes/sir20165080_AppendixD.Rnw @@ -2811,10 +2811,10 @@ invisible(dev.off()) <>= # save R objects that will be used to update the water budget -layers <- c("lay1.top", sprintf("lay%s.bot", 1:3), sprintf("lay%s.zones", 1:3)) +layers <- c("lay1.top", sprintf("lay%s.bot", 1:3)) rs <- subset(rs.model, layers) save(rs, misc, trib, tr.stress.periods, ss.stress.periods, reduction, d.in.mv.ave, - file=file.path(dir.run, "model.rda"), compress=FALSE) + file=file.path(dir.run, "model.rda")) # read raster data from from reference file and store in stack FUN <- function(f, mv.flag=1e+09) {