Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More updates to get travis happy #77

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
^.*\.Rproj$
^\.Rproj\.user$
.travis.yml
LICENSE
README.Rmd
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -16,7 +16,8 @@ Imports:
dplyr
Suggests: testthat,
knitr,
rmarkdown
rmarkdown,
ggplot2
LazyData: true
RoxygenNote: 6.0.1
VignetteBuilder: knitr
11 changes: 7 additions & 4 deletions R/flow_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -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'")
}
Expand All @@ -40,16 +42,17 @@ 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'")
}
flow.ts.grpd <- dplyr::group_by(flow.ts, year)
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
Expand All @@ -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'")
}
Expand Down
4 changes: 4 additions & 0 deletions R/pct_summaries.R
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand All @@ -33,8 +35,10 @@ 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
#' @examples
#'
#' data <- c(1,2,3,4,5)
Expand Down
6 changes: 6 additions & 0 deletions R/sep_censored.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#' sep_censored
#'
#' sep_censored function
#'
#' @param vals char or numeric vector
#'
#' @export
sep_censored <- function(vals){
if(!is.vector(vals)) {
Expand Down
3 changes: 0 additions & 3 deletions man/add_annual_low_flow.Rd

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

3 changes: 0 additions & 3 deletions man/add_annual_median_flow.Rd

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

5 changes: 5 additions & 0 deletions man/calc_pct.Rd

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

2 changes: 2 additions & 0 deletions man/pct_censored.Rd

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

2 changes: 2 additions & 0 deletions man/pct_missing.Rd

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

14 changes: 14 additions & 0 deletions man/sep_censored.Rd

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