Skip to content

Commit

Permalink
merge upstream
Browse files Browse the repository at this point in the history
Merge branch 'main' into fix-528

# Conflicts:
#	NEWS.md
  • Loading branch information
simonpcouch committed Mar 25, 2024
2 parents b770193 + 7d437a3 commit 18fdf9e
Show file tree
Hide file tree
Showing 18 changed files with 262 additions and 49 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: main
pull_request:
branches: main
workflow_dispatch:

name: R-CMD-check

Expand Down Expand Up @@ -48,4 +49,4 @@ jobs:

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
upload-snapshots: true
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Imports:
ggplot2,
glue (>= 1.3.0),
grDevices,
lifecycle,
magrittr,
methods,
patchwork,
Expand All @@ -67,5 +68,5 @@ Config/Needs/website: tidyverse/tidytemplate
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
Config/testthat/edition: 3
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# infer (development version)

* The aliases `p_value()` and `conf_int()`, first deprecated 6 years ago, now
return an error (#530).

* Addresses ggplot2 warnings when shading p-values for test statistics
that are outside of the range of the generated distribution (#528).

Expand Down
8 changes: 2 additions & 6 deletions R/deprecated.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ NULL
#' @export
conf_int <- function(x, level = 0.95, type = "percentile",
point_estimate = NULL) {
.Deprecated("get_confidence_interval")
get_confidence_interval(
x, level = level, type = type, point_estimate = point_estimate
)
lifecycle::deprecate_stop("0.4.0", "conf_int()", "get_confidence_interval()")
}


#' @rdname deprecated
#' @export
p_value <- function(x, obs_stat, direction) {
.Deprecated("get_p_value")
get_p_value(x = x, obs_stat = obs_stat, direction = direction)
lifecycle::deprecate_stop("0.4.0", "conf_int()", "get_p_value()")
}
18 changes: 9 additions & 9 deletions R/wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ t_stat <- function(x, formula,
conf_int = FALSE,
conf_level = 0.95,
...) {
.Deprecated(
new = "observe",
msg = c("The t_stat() wrapper has been deprecated in favor of the more " ,
"general observe(). Please use that function instead.")
lifecycle::deprecate_warn(
when = "1.0.0",
what = "t_stat()",
with = "observe()"
)

check_conf_level(conf_level)
Expand Down Expand Up @@ -298,11 +298,11 @@ chisq_test <- function(x, formula, response = NULL,
#' @export
chisq_stat <- function(x, formula, response = NULL,
explanatory = NULL, ...) {
.Deprecated(
new = "observe",
msg = c("The chisq_stat() wrapper has been deprecated in favor of the ",
"more general observe(). Please use that function instead.")
)
lifecycle::deprecate_warn(
when = "1.0.0",
what = "chisq_stat()",
with = "observe()"
)

# Parse response and explanatory variables
response <- enquo(response)
Expand Down
21 changes: 21 additions & 0 deletions man/figures/lifecycle-archived.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-defunct.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-deprecated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-experimental.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-maturing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-questioning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-soft-deprecated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions man/figures/lifecycle-stable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-superseded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 8 additions & 10 deletions tests/testthat/_snaps/aliases.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# old aliases produce warning
# old aliases produce informative error

Code
res <- gss_calc %>% p_value(obs_stat = -0.2, direction = "right") %>% dplyr::pull()
res <- gss_calc %>% p_value(obs_stat = -0.2, direction = "right")
Condition
Warning:
'p_value' is deprecated.
Use 'get_p_value' instead.
See help("Deprecated")
Error:
! `conf_int()` was deprecated in infer 0.4.0 and is now defunct.
i Please use `get_p_value()` instead.

---

Code
res_ <- gss_permute %>% conf_int()
Condition
Warning:
'conf_int' is deprecated.
Use 'get_confidence_interval' instead.
See help("Deprecated")
Error:
! `conf_int()` was deprecated in infer 0.4.0 and is now defunct.
i Please use `get_confidence_interval()` instead.

6 changes: 4 additions & 2 deletions tests/testthat/_snaps/observe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
res_wrap <- gss_tbl %>% chisq_stat(college ~ partyid)
Condition
Warning:
The chisq_stat() wrapper has been deprecated in favor of the more general observe(). Please use that function instead.
`chisq_stat()` was deprecated in infer 1.0.0.
i Please use `observe()` instead.

---

Code
res_wrap_2 <- gss_tbl %>% t_stat(hours ~ sex, order = c("male", "female"))
Condition
Warning:
The t_stat() wrapper has been deprecated in favor of the more general observe(). Please use that function instead.
`t_stat()` was deprecated in infer 1.0.0.
i Please use `observe()` instead.

Loading

0 comments on commit 18fdf9e

Please sign in to comment.