21.4 Pros and cons of breaking change

  • useR usually do not care enought of the version of the package they use

  • renv is an option to keep track of it inside of project

Deal with it! (and provide users fair warning and time see next part)

21.4.1 Lifecycles, stages and badges

it is an other way to communicate to users. It introduces visual badges.

It can be use at the package, function and arguments levels.

find more with usethis::lifecycle() function!

21.4.2 Deprecated a function

Lifecycle ha a vignette on it: vignette("communicate", package = "lifecycle")

You can generate warning and message to the users with lifecyle package:

Warning message:
Problem while computing `..1 = across(where(is.factor) & !is.ordered, as.character)`.
ℹ️ Predicate functions must be wrapped in `where()`.

# Bad data %>% select(is.ordered)

# Good data %>% select(where(is.ordered))

ℹ️ Please update your code. This message is displayed once per session.

You should graduate the warning!

21.4.3 Dealing with change in a dependency

A functionality you are using will be changed!!!!

One option:

your_function <- function(...) {
  if (packageVersion("otherpkg") >= "1.3.9000") {
  } else {
  # the rest of the function

21.4.4 Superseding a function

Try to preserve old behavior but you want to let them know that they should change!!!