Skip to content

Commit

Permalink
v1.1.0 to CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Jun 23, 2017
1 parent dc6a7ae commit 0502a86
Show file tree
Hide file tree
Showing 65 changed files with 59 additions and 96 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
^data-raw$
README.Rmd
README.md
README.html
^README_FILES/.*
cran-comments.md
.gitignore
.Rhistory
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: WRTDStidal
Type: Package
Title: Weighted Regression for Water Quality Evaluation in Tidal Waters
Version: 1.0.2.9000
Date: 2016-12-08
Version: 1.1.0
Date: 2017-06-23
Author: Marcus W. Beck [aut, cre]
Maintainer: Marcus W. Beck <[email protected]>
Description: An adaptation for estuaries (tidal waters) of weighted regression
Expand Down Expand Up @@ -34,4 +34,4 @@ Depends:
Authors@R: person(given = "Marcus W.", family = "Beck",
role = c("aut","cre"),
email = "[email protected]")
RoxygenNote: 5.0.1
RoxygenNote: 6.0.1
2 changes: 1 addition & 1 deletion R/all_sims.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#'
#' @export
#'
#' @seealso \code{\link{daydat}} for example data, \code{\link{lnQ_sim}} for simulating discharge, \code{\link{lnres_err}} for estimating the eror structure of the response variable, and \code{\link{lnres_sim}} for simulating the response variable
#' @seealso \code{\link{daydat}} for example data, \code{\link{lnQ_sim}} for simulating discharge, \code{\link{lnres_err}} for estimating the error structure of the response variable, and \code{\link{lnres_sim}} for simulating the response variable
#'
#' @import dplyr
#'
Expand Down
2 changes: 1 addition & 1 deletion R/createsrch.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Create a grid of half-window widths to evaluate
#'
#' Create a grid of all unique combintations of half-window widths to evaluate. The result can be passed to \code{\link{winsrch_grid}}.
#' Create a grid of all unique combinations of half-window widths to evaluate. The result can be passed to \code{\link{winsrch_grid}}.
#'
#' @param mos numeric vector of half-window widths for months, a value of one indicates twelve months
#' @param yrs numeric vector of half-window widths for years, a value of one indicates one-year
Expand Down
2 changes: 1 addition & 1 deletion R/dec_time.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#'
#' @export
#'
#' @return A named list of four numeric vecors including \code{day_num} (decimal day on an annual scale), \code{month} (month of the year as integer), \code{year}, and \code{dec_time} (decimal time as sum of \code{year} and \code{day_num})
#' @return A named list of four numeric vectors including \code{day_num} (decimal day on an annual scale), \code{month} (month of the year as integer), \code{year}, and \code{dec_time} (decimal time as sum of \code{year} and \code{day_num})
#'
#' @examples
#' dt <- Sys.Date()
Expand Down
3 changes: 2 additions & 1 deletion R/dynaplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#' # plot using defaults,
#' # defaults to the fiftieth quantile for all years
#' dynaplot(tidfit)
#'
#' \dontrun{
#' # change the defaults
#' dynaplot(tidfit, tau = 0.9, month = 2, years = seq(1980, 1990),
#' col_vec = rainbow(7), alpha = 0.5, size = 3)
Expand All @@ -49,6 +49,7 @@
#' data(tidfitmean)
#'
#' dynaplot(tidfitmean)
#' }
dynaplot <- function(dat_in, ...) UseMethod('dynaplot')

#' @rdname dynaplot
Expand Down
7 changes: 4 additions & 3 deletions R/fitmoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @param alpha numeric value indicating transparency of points or lines
#' @param ... arguments passed to other methods
#'
#' @details The plots are similar to those produced by \code{\link{fitplot}} except the values are facetted by month. This allows an evaluation of trends over time independent of seasonal variation. Multiple observations within each month for each year are averaged for a smoother plot.
#' @details The plots are similar to those produced by \code{\link{fitplot}} except the values are faceted by month. This allows an evaluation of trends over time independent of seasonal variation. Multiple observations within each month for each year are averaged for a smoother plot.
#'
#' @import dplyr ggplot2 RColorBrewer
#'
Expand All @@ -34,7 +34,7 @@
#'
#' # plot using defaults
#' fitmoplot(tidfit)
#'
#' \dontrun{
#' # get the same plot but use default ggplot settings
#' fitmoplot(tidfit, pretty = FALSE)
#'
Expand All @@ -45,7 +45,7 @@
#' fitmoplot(tidfit, predicted = FALSE)
#'
#' # modify the plot as needed using ggplot scales, etc.
#'
#'
#' library(ggplot2)
#'
#' fitmoplot(tidfit, pretty = FALSE, linetype = 'dashed') +
Expand All @@ -65,6 +65,7 @@
#' data(tidfitmean)
#'
#' fitmoplot(tidfitmean)
#' }
fitmoplot <- function(dat_in, ...) UseMethod('fitmoplot')

#' @rdname fitmoplot
Expand Down
2 changes: 1 addition & 1 deletion R/getwts.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' @param dat_in input tidal object
#' @param ref_in row of tidal object as reference for weights
#' @param wt_vars chr string of three elements indicatings names of columns in tidal object that are used for reference row weights
#' @param wt_vars chr string of three elements indicating names of columns in tidal object that are used for reference row weights
#' @param wins list of half-window widths for time, year, and flow
#' @param all logical to return individual weights rather than the product of all three, default \code{FALSE}
#' @param slice logical indicating if data are subset by observations within the maximum window width for faster calculations
Expand Down
2 changes: 1 addition & 1 deletion R/gradcols.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#'
#' @seealso \code{\link{dynaplot}}, \code{\link{gridplot}}, \code{\link{wtsplot}}
#'
#' @return A character vector of colors in hexidecimal notation.
#' @return A character vector of colors in hexadecimal notation.
#'
#' @examples
#'
Expand Down
2 changes: 1 addition & 1 deletion R/lnres_err.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#'
#' @param dat_in input \code{\link[base]{data.frame}} that must include discharge and decimal time columns, see example dataset \code{\link{daydat}}
#' @param yr numeric year value to use for the stationary model, defaults to the median year
#' @param comps logical indicating ifthe WRTDS model used to get response error measures is also returned, see value.
#' @param comps logical indicating if the WRTDS model used to get response error measures is also returned, see value.
#' @param seed optional numeric value for random generation seed
#'
#' @details Random errors for a stationary seasonal water quality time series on a daily time step are generated by modelling residuals from an observed dataset. First, a stationary seasonal model is created by fitting a \code{\link{wrtds}} model and estimating an error distribution the residuals using the \code{\link[forecast]{auto.arima}} function. Accumulated standard errors from the regression are also retained for each residual. Random errors using the estimated auto-regressive structures are simulated using \code{\link[stats]{arima.sim}} for the entire year and multiplied by the corresponding standard error estimate from the regression. The entire year is then repeated for every year in the observed time series. The final simulated errors are rescaled to the range of the original residuals that were used to estimate the distribution.
Expand Down
2 changes: 1 addition & 1 deletion R/nobsplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'
#' @details The plots can be used sample size as an indication of model fit for each unique location in the domain space of the time series. The plots show grids of the number of observations with weights greater than zero for each unique date and salinity/flow combination. The \code{obs} attribute in the \code{tidal} or \code{tidalmean} object is created during model fitting and has the same dimensions as the interpolation grid. Each row is a unique date in the original dataset and each column is a salinity/flow value used to fit each regression (i.e., values in the \code{flo_grd} attribute). In general, low points in the grid may indicate locations in the time series where insufficient data could affect model fit.
#'
#' Unlike \code{\link{gridplot}}, interpolation of the grids for a smoother appearance is not allowed because the objecive is to identify specific locations with low sample size. For the former function, the objective is to characterize general trends over time rather values at specific locations.
#' Unlike \code{\link{gridplot}}, interpolation of the grids for a smoother appearance is not allowed because the objective is to identify specific locations with low sample size. For the former function, the objective is to characterize general trends over time rather values at specific locations.
#'
#' @import dplyr ggplot2 RColorBrewer
#'
Expand Down
2 changes: 1 addition & 1 deletion R/winsrch_grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
#' @details Processing time can be reduced by setting up a parallel backend, as in the examples. Note that this is not effective for small k-values (e.g., < 4) because each fold is sent to a processor, whereas the window width combinations in \code{grid_in} are evaluated in sequence.
#'
#' This function should only be used to view the error surface assocatied with finite combinations of window-width combinations. A faster function to identify the optimal window widths is provided by \code{\link{winsrch_optim}}.
#' This function should only be used to view the error surface associated with finite combinations of window-width combinations. A faster function to identify the optimal window widths is provided by \code{\link{winsrch_optim}}.
#'
#' @return A data frame of the search grid with associated errors for each cross-validation result. Errors for each grid row are averages of all errors for each fold used in cross-validation.
#'
Expand Down
4 changes: 2 additions & 2 deletions R/wrtds.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' @param dat_in input tidal or tidalmean object
#' @param flo_div numeric indicating number of divisions across the range of salinity/flow to create the interpolation grid
#' @param tau numeric vector indicating conitional quantiles to fit in the weighted regression, can be many
#' @param tau numeric vector indicating conditional quantiles to fit in the weighted regression, can be many
#' @param fill_empty logical to fill missing values in interpolation grid using bilinear interpolation by season, see details
#' @param trace logical indicating if progress is shown in the console
#' @param ... arguments passed to or from other methods
Expand All @@ -14,7 +14,7 @@
#'
#' @return Appends interpolation grid attributes to the input object. For a tidal object, this could include multiple grids for each quantile. For tidalmean objects, only one grid is appended to the `fits' attribute, in addition to a back-transformed grid as the `bt_fits' attribute and a grid of the scale parameter of each prediction as the `scls' attribute. Grid rows correspond to the dates in the input data.
#'
#' The \code{fill_empty} arguments uses bilinear interpolation of time by flow to fill missing data in the interpolation grids. The grids are subset by month before interpolating to retain the seasonal variation captured by the models. In gneral, this argument should not be used if more than ten percent of the interpolation grids are missing data. It may be helpful to improve visual appearance of some of the plotting results.
#' The \code{fill_empty} arguments uses bilinear interpolation of time by flow to fill missing data in the interpolation grids. The grids are subset by month before interpolating to retain the seasonal variation captured by the models. In general, this argument should not be used if more than ten percent of the interpolation grids are missing data. It may be helpful to improve visual appearance of some of the plotting results.
#'
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/wrtdscv.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Use k-fold cross-validation to evaluate WRTDS model fit based on supplied half-window widths.
#'
#' @param dat_in input tidal or tidamean object
#' @param dat_in input tidal or tidalmean object
#' @param wins list of input half-window widths of the order months, years, and salinity/flow, passed to \code{\link{getwts}}
#' @param k number of folds to evaluate
#' @param seed_val seed to keep the same dataset divisions between window width comparisons
Expand Down
4 changes: 2 additions & 2 deletions R/wrtdsperf.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
######
#' Get WRTDS peformance metrics
#' Get WRTDS performance metrics
#'
#' Get WRTDS performance metrics indcluding goodness of fit, root mean square error, and normalized mean square error.
#' Get WRTDS performance metrics including goodness of fit, root mean square error, and normalized mean square error.
#'
#' @param dat_in input tidal object which must already have fitted model data
#' @param logspace logical if performance metrics use back-transformed residuals
Expand Down
2 changes: 1 addition & 1 deletion R/wrtdstrnd_sk.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' @importFrom purrr map
#' @importFrom tidyr nest unnest
#'
#' @return A \code{\link[base]{data.frame}} with summary trends for each grouping, including \code{med} as the median value for the period of observation, \code{tau} as the magnitude and direction of the trend, \code{slope} as the Thiel-Sen slope for change per year, \code{chitest} as the signifiance test evaluating heterogeneity between seasons, \code{ztest} indicating significance of the overall trend, and \code{perchg} as 100 multiplied by the ratio of the annual slope to the median estimate of the time period (percent change per year).
#' @return A \code{\link[base]{data.frame}} with summary trends for each grouping, including \code{med} as the median value for the period of observation, \code{tau} as the magnitude and direction of the trend, \code{slope} as the Thiel-Sen slope for change per year, \code{chitest} as the significance test evaluating heterogeneity between seasons, \code{ztest} indicating significance of the overall trend, and \code{perchg} as 100 multiplied by the ratio of the annual slope to the median estimate of the time period (percent change per year).
#'
#' As noted in \code{\link[EnvStats]{kendallSeasonalTrendTest}}, the overall test is not appropriate if \code{chitest} indicates a small p-value.
#'
Expand Down
23 changes: 14 additions & 9 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
## Resubmission

This is a resubmission for a version update.

## Test environments
* local Windows 7 install, R 3.3.2
* local Windows 7 install, Current r-devel (2016-11-06 r71633)
* Windows install (on AppVeyor), R 3.3.2 Patched (2016-11-05 r71630)
* ubuntu 12.04 (on travis-ci), R 3.2.5
* CRAN win-builder (devel and release)

## R CMD check results
There were no ERRORs or WARNINGs.
* Ubuntu precise 12.04.5 (on travis-ci), R 3.4.0
* local Windows 7 install, R 3.4.0
* local Windows 7 install, Current r-devel (2017-06-23 r72824)
* Windows install (on AppVeyor), R 3.4.0 Patched (2017-05-25 r72746)
* win-builder [http://win-builder.r-project.org/](http://win-builder.r-project.org/) (devel and release)

There was 1 NOTE: New submission
## R CMD check results

There were no ERRORs, WARNINGs, or NOTEs.

## Downstream dependencies
None.

None.
1 change: 0 additions & 1 deletion man/aiccrq.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/all_sims.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/annual_agg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/chldat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/chllab.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/chngest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/createsrch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/daydat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/dec_time.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/dynaplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/fill_grd.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/fillpo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/fitmoplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/fitplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0502a86

Please sign in to comment.