Skip to content

Commit 18fdf9e

Browse files
committed
merge upstream
Merge branch 'main' into fix-528 # Conflicts: # NEWS.md
2 parents b770193 + 7d437a3 commit 18fdf9e

18 files changed

+262
-49
lines changed

.github/workflows/check-standard.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: main
66
pull_request:
77
branches: main
8+
workflow_dispatch:
89

910
name: R-CMD-check
1011

@@ -48,4 +49,4 @@ jobs:
4849

4950
- uses: r-lib/actions/check-r-package@v2
5051
with:
51-
upload-snapshots: true
52+
upload-snapshots: true

DESCRIPTION

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Imports:
4242
ggplot2,
4343
glue (>= 1.3.0),
4444
grDevices,
45+
lifecycle,
4546
magrittr,
4647
methods,
4748
patchwork,
@@ -67,5 +68,5 @@ Config/Needs/website: tidyverse/tidytemplate
6768
Encoding: UTF-8
6869
LazyData: true
6970
Roxygen: list(markdown = TRUE)
70-
RoxygenNote: 7.3.0
71+
RoxygenNote: 7.3.1
7172
Config/testthat/edition: 3

NEWS.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# infer (development version)
22

3+
* The aliases `p_value()` and `conf_int()`, first deprecated 6 years ago, now
4+
return an error (#530).
5+
36
* Addresses ggplot2 warnings when shading p-values for test statistics
47
that are outside of the range of the generated distribution (#528).
58

R/deprecated.R

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ NULL
1717
#' @export
1818
conf_int <- function(x, level = 0.95, type = "percentile",
1919
point_estimate = NULL) {
20-
.Deprecated("get_confidence_interval")
21-
get_confidence_interval(
22-
x, level = level, type = type, point_estimate = point_estimate
23-
)
20+
lifecycle::deprecate_stop("0.4.0", "conf_int()", "get_confidence_interval()")
2421
}
2522

2623

2724
#' @rdname deprecated
2825
#' @export
2926
p_value <- function(x, obs_stat, direction) {
30-
.Deprecated("get_p_value")
31-
get_p_value(x = x, obs_stat = obs_stat, direction = direction)
27+
lifecycle::deprecate_stop("0.4.0", "conf_int()", "get_p_value()")
3228
}

R/wrappers.R

+9-9
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ t_stat <- function(x, formula,
150150
conf_int = FALSE,
151151
conf_level = 0.95,
152152
...) {
153-
.Deprecated(
154-
new = "observe",
155-
msg = c("The t_stat() wrapper has been deprecated in favor of the more " ,
156-
"general observe(). Please use that function instead.")
153+
lifecycle::deprecate_warn(
154+
when = "1.0.0",
155+
what = "t_stat()",
156+
with = "observe()"
157157
)
158158

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

307307
# Parse response and explanatory variables
308308
response <- enquo(response)

man/figures/lifecycle-archived.svg

+21
Loading

man/figures/lifecycle-defunct.svg

+21
Loading

man/figures/lifecycle-deprecated.svg

+21
Loading
+21
Loading

man/figures/lifecycle-maturing.svg

+21
Loading

man/figures/lifecycle-questioning.svg

+21
Loading
+21
Loading

man/figures/lifecycle-stable.svg

+29
Loading

man/figures/lifecycle-superseded.svg

+21
Loading

tests/testthat/_snaps/aliases.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
# old aliases produce warning
1+
# old aliases produce informative error
22

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

1110
---
1211

1312
Code
1413
res_ <- gss_permute %>% conf_int()
1514
Condition
16-
Warning:
17-
'conf_int' is deprecated.
18-
Use 'get_confidence_interval' instead.
19-
See help("Deprecated")
15+
Error:
16+
! `conf_int()` was deprecated in infer 0.4.0 and is now defunct.
17+
i Please use `get_confidence_interval()` instead.
2018

tests/testthat/_snaps/observe.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
res_wrap <- gss_tbl %>% chisq_stat(college ~ partyid)
55
Condition
66
Warning:
7-
The chisq_stat() wrapper has been deprecated in favor of the more general observe(). Please use that function instead.
7+
`chisq_stat()` was deprecated in infer 1.0.0.
8+
i Please use `observe()` instead.
89

910
---
1011

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

0 commit comments

Comments
 (0)