From 08a3480c7134bca037fd4ae587fdf7381a1c8fef Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 8 Jun 2017 11:03:30 -0500 Subject: [PATCH 1/4] Getting rid of some warnings --- DESCRIPTION | 3 ++- R/pct_summaries.R | 3 +++ R/sep_censored.R | 6 ++++++ man/calc_pct.Rd | 2 ++ man/pct_censored.Rd | 2 ++ man/pct_missing.Rd | 2 ++ man/sep_censored.Rd | 14 ++++++++++++++ 7 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 man/sep_censored.Rd diff --git a/DESCRIPTION b/DESCRIPTION index de767bd..0ce3a06 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,7 +16,8 @@ Imports: dplyr Suggests: testthat, knitr, - rmarkdown + rmarkdown, + ggplot2 LazyData: true RoxygenNote: 6.0.1 VignetteBuilder: knitr diff --git a/R/pct_summaries.R b/R/pct_summaries.R index 57beaeb..3215d9f 100644 --- a/R/pct_summaries.R +++ b/R/pct_summaries.R @@ -1,6 +1,7 @@ #' @title Censored Data #' @description Flags data censored. #' @param vals vector amount of bad censored +#' @param digits integer number of digits to print #' @examples #' #' data <- c(1,2,3,4,5,16,34) @@ -19,6 +20,7 @@ pct_censored <- function(vals, digits=2){ #' @title Missing Data #' @description Flags missing data #' @param vals vector amount of missing data +#' @param digits integer number of digits to print #' @examples #' #' data <- c(1,2,3,4,5,NA) @@ -35,6 +37,7 @@ pct_missing <- function(vals, digits=2){ #' @title Percent of missing or bad data #' @param ninterest vector amount of bad data #' @param ntotal vector total amount of data +#' @param digits integer number of digits #' @examples #' #' data <- c(1,2,3,4,5) diff --git a/R/sep_censored.R b/R/sep_censored.R index 6cd841a..5a2c3f0 100644 --- a/R/sep_censored.R +++ b/R/sep_censored.R @@ -1,3 +1,9 @@ +#' sep_censored +#' +#' sep_censored function +#' +#' @param vals char or numeric vector +#' #' @export sep_censored <- function(vals){ if(!is.vector(vals)) { diff --git a/man/calc_pct.Rd b/man/calc_pct.Rd index cadc4aa..ac04b1c 100644 --- a/man/calc_pct.Rd +++ b/man/calc_pct.Rd @@ -10,6 +10,8 @@ calc_pct(ninterest, ntotal, digits = 2) \item{ninterest}{vector amount of bad data} \item{ntotal}{vector total amount of data} + +\item{digits}{integer number of digits} } \examples{ diff --git a/man/pct_censored.Rd b/man/pct_censored.Rd index 13e3d63..2a330c2 100644 --- a/man/pct_censored.Rd +++ b/man/pct_censored.Rd @@ -8,6 +8,8 @@ pct_censored(vals, digits = 2) } \arguments{ \item{vals}{vector amount of bad censored} + +\item{digits}{integer number of digits to print} } \description{ Flags data censored. diff --git a/man/pct_missing.Rd b/man/pct_missing.Rd index 0e27ed3..1652ff6 100644 --- a/man/pct_missing.Rd +++ b/man/pct_missing.Rd @@ -8,6 +8,8 @@ pct_missing(vals, digits = 2) } \arguments{ \item{vals}{vector amount of missing data} + +\item{digits}{integer number of digits to print} } \description{ Flags missing data diff --git a/man/sep_censored.Rd b/man/sep_censored.Rd new file mode 100644 index 0000000..9c69ff5 --- /dev/null +++ b/man/sep_censored.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/sep_censored.R +\name{sep_censored} +\alias{sep_censored} +\title{sep_censored} +\usage{ +sep_censored(vals) +} +\arguments{ +\item{vals}{char or numeric vector} +} +\description{ +sep_censored function +} From ae6961cf6ee22f5ca21ec0fb9421a609184bb0d9 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 8 Jun 2017 11:04:29 -0500 Subject: [PATCH 2/4] ignore travis --- .Rbuildignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.Rbuildignore b/.Rbuildignore index 91114bf..098fe88 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,3 @@ ^.*\.Rproj$ ^\.Rproj\.user$ +.travis.yml \ No newline at end of file From 4942b6ca59e6a98c1c8bdf83b0925ed2819d6396 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 8 Jun 2017 11:19:10 -0500 Subject: [PATCH 3/4] Removing more warnings/notes --- .Rbuildignore | 3 ++- DESCRIPTION | 2 +- R/flow_stats.R | 11 +++++++---- R/pct_summaries.R | 1 + man/add_annual_low_flow.Rd | 3 --- man/add_annual_median_flow.Rd | 3 --- man/calc_pct.Rd | 3 +++ 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 098fe88..e5abf30 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,4 @@ ^.*\.Rproj$ ^\.Rproj\.user$ -.travis.yml \ No newline at end of file +.travis.yml +LICENSE \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 0ce3a06..d64254a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: trainR Type: Package -Title: Example package for learning how to develop R packages. +Title: learning how to develop R packages Version: 0.1 Date: 2017-05-25 Authors@R: c( diff --git a/R/flow_stats.R b/R/flow_stats.R index 5b6c838..a58c0a7 100644 --- a/R/flow_stats.R +++ b/R/flow_stats.R @@ -21,6 +21,8 @@ #' } #' add_annual_peak_flow <- function(flow.ts){ + + year <- flow <- ".dplyr" if(!is.data.frame(flow.ts) || any(names(flow.ts) != c('flow', 'year'))) { stop("flow.ts must be a data.frame with columns 'flow' and 'year'") } @@ -40,9 +42,9 @@ add_annual_peak_flow <- function(flow.ts){ #' #' @return flow.ts.med numeric USGS annual median flow #' -#' @examples -#' add_annual_median_flow <- function(flow.ts){ + + year <- flow <- ".dplyr" if(!is.data.frame(flow.ts) || any(names(flow.ts) != c('flow', 'year'))) { stop("flow.ts must be a data.frame with columns 'flow' and 'year'") } @@ -50,6 +52,7 @@ add_annual_median_flow <- function(flow.ts){ flow.ts.med <- dplyr::mutate(flow.ts.grpd, flow.med = median(flow)) return(flow.ts.med) } + #' @title add_annual_low_flow #' #' @description Calculate annual low flow @@ -62,9 +65,9 @@ add_annual_median_flow <- function(flow.ts){ #' #' @return flow.ts.low numeric USGS annual low flow #' -#' @examples -#' add_annual_low_flow <- function(flow.ts){ + + year <- flow <- ".dplyr" if(!is.data.frame(flow.ts) || any(names(flow.ts) != c('flow', 'year'))) { stop("flow.ts must be a data.frame with columns 'flow' and 'year'") } diff --git a/R/pct_summaries.R b/R/pct_summaries.R index 3215d9f..4f6bba2 100644 --- a/R/pct_summaries.R +++ b/R/pct_summaries.R @@ -35,6 +35,7 @@ pct_missing <- function(vals, digits=2){ return(na.pct) } #' @title Percent of missing or bad data +#' @description Percent of missing or bad data #' @param ninterest vector amount of bad data #' @param ntotal vector total amount of data #' @param digits integer number of digits diff --git a/man/add_annual_low_flow.Rd b/man/add_annual_low_flow.Rd index 73a48c0..649f5dc 100644 --- a/man/add_annual_low_flow.Rd +++ b/man/add_annual_low_flow.Rd @@ -15,6 +15,3 @@ flow.ts.low numeric USGS annual low flow \description{ Calculate annual low flow } -\examples{ - -} diff --git a/man/add_annual_median_flow.Rd b/man/add_annual_median_flow.Rd index ad38a64..5998570 100644 --- a/man/add_annual_median_flow.Rd +++ b/man/add_annual_median_flow.Rd @@ -15,6 +15,3 @@ flow.ts.med numeric USGS annual median flow \description{ Calculate annual median flow } -\examples{ - -} diff --git a/man/calc_pct.Rd b/man/calc_pct.Rd index ac04b1c..8ce3cdc 100644 --- a/man/calc_pct.Rd +++ b/man/calc_pct.Rd @@ -13,6 +13,9 @@ calc_pct(ninterest, ntotal, digits = 2) \item{digits}{integer number of digits} } +\description{ +Percent of missing or bad data +} \examples{ data <- c(1,2,3,4,5) From 5c04c0d60c539db2b8bd123d9e6d55d6ad18e486 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 8 Jun 2017 11:28:17 -0500 Subject: [PATCH 4/4] ignore .Rmd readme --- .Rbuildignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index e5abf30..7248549 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,4 +1,5 @@ ^.*\.Rproj$ ^\.Rproj\.user$ .travis.yml -LICENSE \ No newline at end of file +LICENSE +README.Rmd \ No newline at end of file