File: manage.R

package info (click to toggle)
r-cran-lifecycle 1.0.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 576 kB
  • sloc: sh: 15; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 1,350 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## ---- include = FALSE---------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
options("lifecycle:::calling_package" = "tibble")

## -----------------------------------------------------------------------------
data_frame <- function(...) {
  lifecycle::deprecate_warn("1.1.0", "data_frame()", "tibble()")
  tibble::tibble(...)
}

## -----------------------------------------------------------------------------
df1 <- data_frame(x = 1, y = 2)
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
df2 <- data_frame(a = "apple", b = "banana")

## ---- eval = FALSE------------------------------------------------------------
#  lifecycle::last_lifecycle_warnings()
#  #> [[1]]
#  #> <deprecated>
#  #> message: `data_frame()` was deprecated in tibble 1.1.0.
#  #> Please use `tibble()` instead.
#  #> Backtrace:
#  #>  1. global::data_frame(x = 1)

## -----------------------------------------------------------------------------
options(lifecycle_verbosity = "warning")
df1 <- data_frame(x = 1, y = 2)
df2 <- data_frame(a = "apple", b = "banana")

## ---- error = TRUE------------------------------------------------------------
options("lifecycle_verbosity" = "error")
df1 <- data_frame(x = 1, y = 2)