Skip to content

Commit

Permalink
- Switched default pick argument to longest following recommendat…
Browse files Browse the repository at this point in the history
…ions from Ecofish and Lotic.
  • Loading branch information
joethorley committed Feb 14, 2024
1 parent 0fdaa60 commit d859a01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions R/gsdd-cf.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#' @param pick A string specifying whether to pick the
#' "longest", "shortest", "first" or "last" 'season' or the season with the
#' "biggest" or "smallest" GSDD. By default the returned value is the
#' sum of the GSDD values for "all" 'seasons'.
#' the GSDD value for the "longest" 'season'.
#' @param msgs A flag specifying whether to provide messages.
#' @return A non-negative real number of the GSDD.
#' @export
Expand All @@ -77,7 +77,7 @@ gsdd_cf <- function(x,
start_temp = 5,
end_temp = 4,
window_width = 7,
pick = "all",
pick = "longest",
msgs = TRUE) {
chk_numeric(x)
chk_vector(x)
Expand Down
4 changes: 2 additions & 2 deletions man/gsdd_cf.Rd

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

4 changes: 2 additions & 2 deletions tests/testthat/test-gsdd-cf.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ test_that("Gets growth period with smallest GSDD.", {

test_that("Gets growth period with all GSDD.", {
x <- c(rep(0, 100), rep(10, 50), rep(0, 50), rep(20, 40), rep(0, 115))
gsdd <- gsdd_cf(x, window_width = 3, start_temp = 9, end_temp = 9)
gsdd <- gsdd_cf(x, window_width = 3, start_temp = 9, end_temp = 9, pick = "all")
expect_equal(gsdd, 1300)
})

Expand Down Expand Up @@ -148,7 +148,7 @@ test_that("Gets growth period longest", {
expect_equal(gsdd, NA_real_)
gsdd <- gsdd_cf(x,
window_width = 3, start_temp = 9, end_temp = 9, msgs = FALSE,
ignore_truncation = TRUE, pick = "longest"
ignore_truncation = TRUE
)
expect_equal(gsdd, 500)
})
Expand Down

0 comments on commit d859a01

Please sign in to comment.