Skip to content

Commit

Permalink
- Removed gsdd_vctr().
Browse files Browse the repository at this point in the history
- Removed `ignore_truncation` argument from gsdd functions.
- Set lower default `min_length` values.
  • Loading branch information
joethorley committed Mar 25, 2024
1 parent 7924389 commit b3c01e0
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 190 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export(freshwaterfish)
export(gdd)
export(gsdd)
export(gsdd_cf)
export(gsdd_vctr)
export(interpolate_numeric_vector)
import(chk)
importFrom(fishbc,fbc_common_name)
Expand Down
7 changes: 4 additions & 3 deletions R/gdd.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
gdd <- function(
x,
end_date = as.Date("1972-09-30"),
ignore_truncation = FALSE,
min_length = NULL,
min_length = 61,
msgs = TRUE
) {
chk_whole_number(min_length)
chk_range(min_length, c(14, 213))

gsdd::gdd(
x,
end_date = end_date,
ignore_truncation = ignore_truncation,
min_length = min_length,
pick = "longest",
msgs = msgs)
Expand Down
13 changes: 7 additions & 6 deletions R/gsdd-cf.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Calculate Growing Season Degree Days (GSDD)
#'
#' Soft-deprecated for [gsdd_vctr()].
#' Soft-deprecated for [gsdd::gsdd_vctr()].
#'
#' @inheritParams gsdd::gsdd_vctr
#' @return A non-negative real number of the GSDD.
Expand All @@ -12,14 +12,15 @@
#' gsdd_cf(gsdd::temperature_data$temperature)
gsdd_cf <- function(
x,
ignore_truncation = FALSE,
min_length = 184,
min_length = 122,
msgs = TRUE
) {
lifecycle::deprecate_soft("0.1.2", "gsdd_cf()", with = "gsdd_vctr()")
gsdd_vctr(
lifecycle::deprecate_soft("0.1.2", "gsdd_cf()", with = "gsdd::gsdd_vctr()")
chk_whole_number(min_length)
chk_range(min_length, c(14, 274))

gsdd::gsdd_vctr(
x,
ignore_truncation = ignore_truncation,
min_length = min_length,
msgs = msgs)
}
26 changes: 0 additions & 26 deletions R/gsdd-vctr.R

This file was deleted.

6 changes: 3 additions & 3 deletions R/gsdd.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#' gsdd(gsdd::temperature_data)
gsdd <- function(
x,
ignore_truncation = FALSE,
min_length = 274,
min_length = 122,
msgs = TRUE
) {
chk_whole_number(min_length)
chk_range(min_length, c(14, 274))

gsdd::gsdd(
x,
ignore_truncation = ignore_truncation,
min_length = min_length,
pick = "longest",
msgs = msgs)
Expand Down
10 changes: 1 addition & 9 deletions man/gdd.Rd

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

7 changes: 1 addition & 6 deletions man/gsdd.Rd

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

9 changes: 2 additions & 7 deletions man/gsdd_cf.Rd

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

39 changes: 0 additions & 39 deletions man/gsdd_vctr.Rd

This file was deleted.

90 changes: 0 additions & 90 deletions tests/testthat/test-gssd-vctr.R

This file was deleted.

0 comments on commit b3c01e0

Please sign in to comment.