tidyverse 2.0.0

tidyverse
tidyverse 2.0.0 has been released!
Published

March 8, 2023

Install tidyverse 2.0.0 with:

pak::pak("cran/tidyverse@2.0.0")

Load the tidyverse with:

── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.0     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.1     ✔ tibble    3.2.1
✔ lubridate 1.9.2     ✔ tidyr     1.3.0
✔ purrr     1.0.1     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the ]8;;http://conflicted.r-lib.org/conflicted package]8;; to force all conflicts to become errors

Did you notice?

Click to reveal!

Welcome to the core tidyverse, lubridate!

lubridate!


Lubridate package hex sticker with a calendar


lubridate is now part of the core tidyverse! Loading the tidyverse automatically attaches lubridate, meaning that you do not have load it separately.

conflicted package

You may have noticed this message:

 Use the conflicted package to force all conflicts to become errors

tidyverse 2.0.0 now advertises the conflicted package.

Packages can have conflicts (i.e., contain functions of the same name). Normally, the package loaded last “wins” and masks (overrides) the other package’s function, resulting in confusing errors.


Attaching package: 'MASS'
The following object is masked from 'package:dplyr':

    select
select
function (obj) 
UseMethod("select")
<bytecode: 0x7f99b46b93a0>
<environment: namespace:MASS>

With conflicted, you get an explicit error:

Error:
! [conflicted] select found in 2 packages.
Either pick the one you want with `::`:
• MASS::select
• dplyr::select
Or declare a preference with `conflicts_prefer()`:
• `conflicts_prefer(MASS::select)`
• `conflicts_prefer(dplyr::select)`

It asks you to either identify the namespace for each call:

dplyr::select

Or, declare a preference with conflicts_prefer():

That way you know there’s a problem and how to resolve it.

Learn more