R session info info

code
Author
Published

October 13, 2018

US Attorney General Jeff Sessions takes a sip of water.

US Attorney-General Jeff Sessions-Info.

tl;dr

You can get information about your R session using several different functions.

Session info?

What

Session info is just some details about your working environment like your version of R, the locale it’s running from and any loaded packages.

It gives a snapshot to help people reproduce what you’ve done or spot any anomalies. You might get asked for this if someone is diagnosing your R problem. You may also see it at the end of blog posts or reports.

You might typically print this to the console with the base function sessionInfo(), but it gives a lot of information by default. Other functions have been created to make the output more friendly.

This post

I’ve been using sessionInfo(), but read about Yihui’s session_info() function in his {xfun} package and saw Mat at machinegurning.com using session_info() from {devtools}.

I want to see the outputs side-by-side for my own curiosity.

Load packages

Let’s grab some packages from different sources to see how they’re represented in the output of each session info function.

Click to expand package-installation details
# From CRAN
# install.packages("package-name")
library(dplyr)
library(purrr)
library(tidyxl)

# Dev versions of packages from rOpenSci
# remotes::install_github("ropensci/packagename")
library(rfishbase)
library(rgbif)
library(helminthR)

# Bioconductor
# Install instructions here: https://bioconductor.org/install/
# BiocManager::install(c("GenomicFeatures", "AnnotationDbi"))
library(GenomicFeatures)
library(AnnotationDbi)

For a bit of diversity, I’ve grabbed some packages from:

Functions demo

We’ll be looking at:

  1. {utils}
  2. {devtools}
  3. {sessioninfo}
  4. {xfun}

Click the package name to jump to that section.

Note

I later re-rendered this post, so the output from each function will show a date after the initial publication date of this post

1. Using {utils}

From the documentation for the function:

Print version information about R, the OS and attached or loaded packages.

What do you get? Loads of stuff:

  • R version, platform and OS
  • matrix products, BLAS and LAPACK
  • locale (where you’re running R from)
  • packages – attached base packages, other attached packages, and loaded packages via namespace (but not attached) in separate sections with their version numbers

Maybe that’s too much stuff. Also I don’t really know what the BLAS and LAPACK stuff is; something to do with linear algebra. There’s also no notation to say where the packages came from (CRAN, GitHub or Bioconductor). But it’s pretty human-readable.

Click to expand the output from this function
utils::sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.2.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/London
tzcode source: internal

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] GenomicFeatures_1.52.1 AnnotationDbi_1.62.2   Biobase_2.60.0        
 [4] GenomicRanges_1.52.0   GenomeInfoDb_1.36.1    IRanges_2.34.1        
 [7] S4Vectors_0.38.1       BiocGenerics_0.46.0    helminthR_1.0.10      
[10] rgbif_3.7.7.2          rfishbase_4.1.2        tidyxl_1.0.8          
[13] purrr_1.0.1            dplyr_1.1.2           

loaded via a namespace (and not attached):
 [1] DBI_1.1.3                   bitops_1.0-7               
 [3] biomaRt_2.56.1              rlang_1.1.1                
 [5] magrittr_2.0.3              matrixStats_1.0.0          
 [7] compiler_4.3.1              RSQLite_2.3.1              
 [9] png_0.1-8                   vctrs_0.6.3                
[11] rvest_1.0.3                 stringr_1.5.0              
[13] pkgconfig_2.0.3             crayon_1.5.2               
[15] fastmap_1.1.1               dbplyr_2.3.3               
[17] XVector_0.40.0              fontawesome_0.5.1          
[19] utf8_1.2.3                  Rsamtools_2.16.0           
[21] rmarkdown_2.23              tzdb_0.4.0                 
[23] bit_4.0.5                   xfun_0.39                  
[25] zlibbioc_1.46.0             cachem_1.0.8               
[27] jsonlite_1.8.7              progress_1.2.2             
[29] blob_1.2.4                  DelayedArray_0.26.7        
[31] BiocParallel_1.34.2         parallel_4.3.1             
[33] prettyunits_1.1.1           R6_2.5.1                   
[35] stringi_1.7.12              rtracklayer_1.60.0         
[37] Rcpp_1.0.11                 SummarizedExperiment_1.30.2
[39] knitr_1.43.1                readr_2.1.4                
[41] Matrix_1.6-0                tidyselect_1.2.0           
[43] rstudioapi_0.15.0           abind_1.4-5                
[45] yaml_2.3.7                  codetools_0.2-19           
[47] curl_5.0.1                  lattice_0.21-8             
[49] tibble_3.2.1                plyr_1.8.8                 
[51] KEGGREST_1.40.0             evaluate_0.21              
[53] BiocFileCache_2.8.0         xml2_1.3.5                 
[55] Biostrings_2.68.1           pillar_1.9.0               
[57] filelock_1.0.2              MatrixGenerics_1.12.3      
[59] whisker_0.4.1               generics_0.1.3             
[61] RCurl_1.98-1.12             hms_1.1.3                  
[63] ggplot2_3.4.2               munsell_0.5.0              
[65] scales_1.2.1                glue_1.6.2                 
[67] lazyeval_0.2.2              tools_4.3.1                
[69] BiocIO_1.10.0               data.table_1.14.8          
[71] GenomicAlignments_1.36.0    fs_1.6.3                   
[73] XML_3.99-0.14               grid_4.3.1                 
[75] colorspace_2.1-0            GenomeInfoDbData_1.2.10    
[77] restfulr_0.0.15             cli_3.6.1                  
[79] rappdirs_0.3.3              fansi_1.0.4                
[81] S4Arrays_1.0.5              gtable_0.3.3               
[83] oai_0.4.0                   digest_0.6.33              
[85] rjson_0.2.21                htmlwidgets_1.6.2          
[87] memoise_2.0.1               htmltools_0.5.5            
[89] lifecycle_1.0.3             httr_1.4.6                 
[91] bit64_4.0.5                

2. Using {devtools}

From the documentation for the function:

This is sessionInfo() re-written from scratch to both exclude data that’s rarely useful (e.g., the full collate string or base packages loaded) and include stuff you’d like to know (e.g., where a package was installed from).

What do you get? You get basically what’s in sessionInfo()

  • sections split into ‘session info’ and ‘packages’
  • version, system, UI, language, locale, timezone and date
  • package names with version number, date and source (CRAN, Bioconductor, GitHub, local)

It’s even more human-readable in the packages section, where the output is in table format and in alphabetical order. In particular, there’s a column to tell you where the package came from. For example, see how the {helminthR} package is from github (ropensci/helminthR@549957a) (i.e. the development version with a specific Git ref hash) and there’s an asterisk in the row to show you it was attached in the session.

Click to expand the output from this function
devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.1 (2023-06-16)
 os       macOS Ventura 13.2.1
 system   aarch64, darwin20
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/London
 date     2023-08-08
 pandoc   3.1.1 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package              * version   date (UTC) lib source
 abind                  1.4-5     2016-07-21 [1] CRAN (R 4.3.0)
 AnnotationDbi        * 1.62.2    2023-07-02 [1] Bioconductor
 Biobase              * 2.60.0    2023-05-08 [1] Bioconductor
 BiocFileCache          2.8.0     2023-05-08 [1] Bioconductor
 BiocGenerics         * 0.46.0    2023-06-04 [1] Bioconductor
 BiocIO                 1.10.0    2023-05-08 [1] Bioconductor
 BiocParallel           1.34.2    2023-05-28 [1] Bioconductor
 biomaRt                2.56.1    2023-06-11 [1] Bioconductor
 Biostrings             2.68.1    2023-05-21 [1] Bioconductor
 bit                    4.0.5     2022-11-15 [1] CRAN (R 4.3.0)
 bit64                  4.0.5     2020-08-30 [1] CRAN (R 4.3.0)
 bitops                 1.0-7     2021-04-24 [1] CRAN (R 4.3.0)
 blob                   1.2.4     2023-03-17 [1] CRAN (R 4.3.0)
 cachem                 1.0.8     2023-05-01 [1] CRAN (R 4.3.0)
 callr                  3.7.3     2022-11-02 [1] CRAN (R 4.3.0)
 cli                    3.6.1     2023-03-23 [1] CRAN (R 4.3.0)
 codetools              0.2-19    2023-02-01 [1] CRAN (R 4.3.1)
 colorspace             2.1-0     2023-01-23 [1] CRAN (R 4.3.0)
 crayon                 1.5.2     2022-09-29 [1] CRAN (R 4.3.0)
 curl                   5.0.1     2023-06-07 [1] CRAN (R 4.3.0)
 data.table             1.14.8    2023-02-17 [1] CRAN (R 4.3.0)
 DBI                    1.1.3     2022-06-18 [1] CRAN (R 4.3.0)
 dbplyr                 2.3.3     2023-07-07 [1] CRAN (R 4.3.0)
 DelayedArray           0.26.7    2023-07-30 [1] Bioconductor
 devtools               2.4.5     2022-10-11 [1] CRAN (R 4.3.0)
 digest                 0.6.33    2023-07-07 [1] CRAN (R 4.3.0)
 dplyr                * 1.1.2     2023-04-20 [1] CRAN (R 4.3.0)
 ellipsis               0.3.2     2021-04-29 [1] CRAN (R 4.3.0)
 evaluate               0.21      2023-05-05 [1] CRAN (R 4.3.0)
 fansi                  1.0.4     2023-01-22 [1] CRAN (R 4.3.0)
 fastmap                1.1.1     2023-02-24 [1] CRAN (R 4.3.0)
 filelock               1.0.2     2018-10-05 [1] CRAN (R 4.3.0)
 fontawesome            0.5.1     2023-04-18 [1] CRAN (R 4.3.0)
 fs                     1.6.3     2023-07-20 [1] CRAN (R 4.3.0)
 generics               0.1.3     2022-07-05 [1] CRAN (R 4.3.0)
 GenomeInfoDb         * 1.36.1    2023-07-02 [1] Bioconductor
 GenomeInfoDbData       1.2.10    2023-08-08 [1] Bioconductor
 GenomicAlignments      1.36.0    2023-05-08 [1] Bioconductor
 GenomicFeatures      * 1.52.1    2023-07-02 [1] Bioconductor
 GenomicRanges        * 1.52.0    2023-05-08 [1] Bioconductor
 ggplot2                3.4.2     2023-04-03 [1] CRAN (R 4.3.0)
 glue                   1.6.2     2022-02-24 [1] CRAN (R 4.3.0)
 gtable                 0.3.3     2023-03-21 [1] CRAN (R 4.3.0)
 helminthR            * 1.0.10    2023-08-08 [1] Github (ropensci/helminthR@549957a)
 hms                    1.1.3     2023-03-21 [1] CRAN (R 4.3.0)
 htmltools              0.5.5     2023-03-23 [1] CRAN (R 4.3.0)
 htmlwidgets            1.6.2     2023-03-17 [1] CRAN (R 4.3.0)
 httpuv                 1.6.11    2023-05-11 [1] CRAN (R 4.3.0)
 httr                   1.4.6     2023-05-08 [1] CRAN (R 4.3.0)
 IRanges              * 2.34.1    2023-07-02 [1] Bioconductor
 jsonlite               1.8.7     2023-06-29 [1] CRAN (R 4.3.0)
 KEGGREST               1.40.0    2023-05-08 [1] Bioconductor
 knitr                  1.43.1    2023-06-21 [1] https://yihui.r-universe.dev (R 4.3.1)
 later                  1.3.1     2023-05-02 [1] CRAN (R 4.3.0)
 lattice                0.21-8    2023-04-05 [1] CRAN (R 4.3.1)
 lazyeval               0.2.2     2019-03-15 [1] CRAN (R 4.3.0)
 lifecycle              1.0.3     2022-10-07 [1] CRAN (R 4.3.0)
 magrittr               2.0.3     2022-03-30 [1] CRAN (R 4.3.0)
 Matrix                 1.6-0     2023-07-08 [1] CRAN (R 4.3.0)
 MatrixGenerics         1.12.3    2023-07-30 [1] Bioconductor
 matrixStats            1.0.0     2023-06-02 [1] CRAN (R 4.3.0)
 memoise                2.0.1     2021-11-26 [1] CRAN (R 4.3.0)
 mime                   0.12      2021-09-28 [1] CRAN (R 4.3.0)
 miniUI                 0.1.1.1   2018-05-18 [1] CRAN (R 4.3.0)
 munsell                0.5.0     2018-06-12 [1] CRAN (R 4.3.0)
 oai                    0.4.0     2022-11-10 [1] CRAN (R 4.3.0)
 pillar                 1.9.0     2023-03-22 [1] CRAN (R 4.3.0)
 pkgbuild               1.4.2     2023-06-26 [1] CRAN (R 4.3.0)
 pkgconfig              2.0.3     2019-09-22 [1] CRAN (R 4.3.0)
 pkgload                1.3.2.1   2023-07-08 [1] CRAN (R 4.3.0)
 plyr                   1.8.8     2022-11-11 [1] CRAN (R 4.3.0)
 png                    0.1-8     2022-11-29 [1] CRAN (R 4.3.0)
 prettyunits            1.1.1     2020-01-24 [1] CRAN (R 4.3.0)
 processx               3.8.2     2023-06-30 [1] CRAN (R 4.3.0)
 profvis                0.3.8     2023-05-02 [1] CRAN (R 4.3.0)
 progress               1.2.2     2019-05-16 [1] CRAN (R 4.3.0)
 promises               1.2.0.1   2021-02-11 [1] CRAN (R 4.3.0)
 ps                     1.7.5     2023-04-18 [1] CRAN (R 4.3.0)
 purrr                * 1.0.1     2023-01-10 [1] CRAN (R 4.3.0)
 R6                     2.5.1     2021-08-19 [1] CRAN (R 4.3.0)
 rappdirs               0.3.3     2021-01-31 [1] CRAN (R 4.3.0)
 Rcpp                   1.0.11    2023-07-06 [1] CRAN (R 4.3.0)
 RCurl                  1.98-1.12 2023-03-27 [1] CRAN (R 4.3.0)
 readr                  2.1.4     2023-02-10 [1] CRAN (R 4.3.0)
 remotes                2.4.2.1   2023-07-18 [1] CRAN (R 4.3.0)
 restfulr               0.0.15    2022-06-16 [1] CRAN (R 4.3.0)
 rfishbase            * 4.1.2     2023-06-02 [1] CRAN (R 4.3.0)
 rgbif                * 3.7.7.2   2023-08-08 [1] Github (ropensci/rgbif@3bdfdb2)
 rjson                  0.2.21    2022-01-09 [1] CRAN (R 4.3.0)
 rlang                  1.1.1     2023-04-28 [1] CRAN (R 4.3.0)
 rmarkdown              2.23      2023-07-01 [1] CRAN (R 4.3.0)
 Rsamtools              2.16.0    2023-06-04 [1] Bioconductor
 RSQLite                2.3.1     2023-04-03 [1] CRAN (R 4.3.0)
 rstudioapi             0.15.0    2023-07-07 [1] CRAN (R 4.3.0)
 rtracklayer            1.60.0    2023-05-08 [1] Bioconductor
 rvest                  1.0.3     2022-08-19 [1] CRAN (R 4.3.0)
 S4Arrays               1.0.5     2023-07-30 [1] Bioconductor
 S4Vectors            * 0.38.1    2023-05-08 [1] Bioconductor
 scales                 1.2.1     2022-08-20 [1] CRAN (R 4.3.0)
 sessioninfo            1.2.2     2021-12-06 [1] CRAN (R 4.3.0)
 shiny                  1.7.4.1   2023-07-06 [1] CRAN (R 4.3.0)
 stringi                1.7.12    2023-01-11 [1] CRAN (R 4.3.0)
 stringr                1.5.0     2022-12-02 [1] CRAN (R 4.3.0)
 SummarizedExperiment   1.30.2    2023-06-11 [1] Bioconductor
 tibble                 3.2.1     2023-03-20 [1] CRAN (R 4.3.0)
 tidyselect             1.2.0     2022-10-10 [1] CRAN (R 4.3.0)
 tidyxl               * 1.0.8     2022-09-01 [1] CRAN (R 4.3.0)
 tzdb                   0.4.0     2023-05-12 [1] CRAN (R 4.3.0)
 urlchecker             1.0.1     2021-11-30 [1] CRAN (R 4.3.0)
 usethis                2.2.2     2023-07-06 [1] CRAN (R 4.3.0)
 utf8                   1.2.3     2023-01-31 [1] CRAN (R 4.3.0)
 vctrs                  0.6.3     2023-06-14 [1] CRAN (R 4.3.0)
 whisker                0.4.1     2022-12-05 [1] CRAN (R 4.3.0)
 xfun                   0.39      2023-04-20 [1] CRAN (R 4.3.0)
 XML                    3.99-0.14 2023-03-19 [1] CRAN (R 4.3.0)
 xml2                   1.3.5     2023-07-06 [1] CRAN (R 4.3.0)
 xtable                 1.8-4     2019-04-21 [1] CRAN (R 4.3.0)
 XVector                0.40.0    2023-05-08 [1] Bioconductor
 yaml                   2.3.7     2023-01-23 [1] CRAN (R 4.3.0)
 zlibbioc               1.46.0    2023-05-08 [1] Bioconductor

 [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library

──────────────────────────────────────────────────────────────────────────────

3. Using {sessioninfo}

From the CRAN page for the package:

It is similar to utils::sessionInfo(), but includes more information about packages, and where they were installed from.

What do you get? Basically the same as utils::sessionInfo(). Note that the final column of output – the source column is wrapped below.

Click to expand the output from this function
sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.1 (2023-06-16)
 os       macOS Ventura 13.2.1
 system   aarch64, darwin20
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/London
 date     2023-08-08
 pandoc   3.1.1 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package              * version   date (UTC) lib source
 abind                  1.4-5     2016-07-21 [1] CRAN (R 4.3.0)
 AnnotationDbi        * 1.62.2    2023-07-02 [1] Bioconductor
 Biobase              * 2.60.0    2023-05-08 [1] Bioconductor
 BiocFileCache          2.8.0     2023-05-08 [1] Bioconductor
 BiocGenerics         * 0.46.0    2023-06-04 [1] Bioconductor
 BiocIO                 1.10.0    2023-05-08 [1] Bioconductor
 BiocParallel           1.34.2    2023-05-28 [1] Bioconductor
 biomaRt                2.56.1    2023-06-11 [1] Bioconductor
 Biostrings             2.68.1    2023-05-21 [1] Bioconductor
 bit                    4.0.5     2022-11-15 [1] CRAN (R 4.3.0)
 bit64                  4.0.5     2020-08-30 [1] CRAN (R 4.3.0)
 bitops                 1.0-7     2021-04-24 [1] CRAN (R 4.3.0)
 blob                   1.2.4     2023-03-17 [1] CRAN (R 4.3.0)
 cachem                 1.0.8     2023-05-01 [1] CRAN (R 4.3.0)
 callr                  3.7.3     2022-11-02 [1] CRAN (R 4.3.0)
 cli                    3.6.1     2023-03-23 [1] CRAN (R 4.3.0)
 codetools              0.2-19    2023-02-01 [1] CRAN (R 4.3.1)
 colorspace             2.1-0     2023-01-23 [1] CRAN (R 4.3.0)
 crayon                 1.5.2     2022-09-29 [1] CRAN (R 4.3.0)
 curl                   5.0.1     2023-06-07 [1] CRAN (R 4.3.0)
 data.table             1.14.8    2023-02-17 [1] CRAN (R 4.3.0)
 DBI                    1.1.3     2022-06-18 [1] CRAN (R 4.3.0)
 dbplyr                 2.3.3     2023-07-07 [1] CRAN (R 4.3.0)
 DelayedArray           0.26.7    2023-07-30 [1] Bioconductor
 devtools               2.4.5     2022-10-11 [1] CRAN (R 4.3.0)
 digest                 0.6.33    2023-07-07 [1] CRAN (R 4.3.0)
 dplyr                * 1.1.2     2023-04-20 [1] CRAN (R 4.3.0)
 ellipsis               0.3.2     2021-04-29 [1] CRAN (R 4.3.0)
 evaluate               0.21      2023-05-05 [1] CRAN (R 4.3.0)
 fansi                  1.0.4     2023-01-22 [1] CRAN (R 4.3.0)
 fastmap                1.1.1     2023-02-24 [1] CRAN (R 4.3.0)
 filelock               1.0.2     2018-10-05 [1] CRAN (R 4.3.0)
 fontawesome            0.5.1     2023-04-18 [1] CRAN (R 4.3.0)
 fs                     1.6.3     2023-07-20 [1] CRAN (R 4.3.0)
 generics               0.1.3     2022-07-05 [1] CRAN (R 4.3.0)
 GenomeInfoDb         * 1.36.1    2023-07-02 [1] Bioconductor
 GenomeInfoDbData       1.2.10    2023-08-08 [1] Bioconductor
 GenomicAlignments      1.36.0    2023-05-08 [1] Bioconductor
 GenomicFeatures      * 1.52.1    2023-07-02 [1] Bioconductor
 GenomicRanges        * 1.52.0    2023-05-08 [1] Bioconductor
 ggplot2                3.4.2     2023-04-03 [1] CRAN (R 4.3.0)
 glue                   1.6.2     2022-02-24 [1] CRAN (R 4.3.0)
 gtable                 0.3.3     2023-03-21 [1] CRAN (R 4.3.0)
 helminthR            * 1.0.10    2023-08-08 [1] Github (ropensci/helminthR@549957a)
 hms                    1.1.3     2023-03-21 [1] CRAN (R 4.3.0)
 htmltools              0.5.5     2023-03-23 [1] CRAN (R 4.3.0)
 htmlwidgets            1.6.2     2023-03-17 [1] CRAN (R 4.3.0)
 httpuv                 1.6.11    2023-05-11 [1] CRAN (R 4.3.0)
 httr                   1.4.6     2023-05-08 [1] CRAN (R 4.3.0)
 IRanges              * 2.34.1    2023-07-02 [1] Bioconductor
 jsonlite               1.8.7     2023-06-29 [1] CRAN (R 4.3.0)
 KEGGREST               1.40.0    2023-05-08 [1] Bioconductor
 knitr                  1.43.1    2023-06-21 [1] https://yihui.r-universe.dev (R 4.3.1)
 later                  1.3.1     2023-05-02 [1] CRAN (R 4.3.0)
 lattice                0.21-8    2023-04-05 [1] CRAN (R 4.3.1)
 lazyeval               0.2.2     2019-03-15 [1] CRAN (R 4.3.0)
 lifecycle              1.0.3     2022-10-07 [1] CRAN (R 4.3.0)
 magrittr               2.0.3     2022-03-30 [1] CRAN (R 4.3.0)
 Matrix                 1.6-0     2023-07-08 [1] CRAN (R 4.3.0)
 MatrixGenerics         1.12.3    2023-07-30 [1] Bioconductor
 matrixStats            1.0.0     2023-06-02 [1] CRAN (R 4.3.0)
 memoise                2.0.1     2021-11-26 [1] CRAN (R 4.3.0)
 mime                   0.12      2021-09-28 [1] CRAN (R 4.3.0)
 miniUI                 0.1.1.1   2018-05-18 [1] CRAN (R 4.3.0)
 munsell                0.5.0     2018-06-12 [1] CRAN (R 4.3.0)
 oai                    0.4.0     2022-11-10 [1] CRAN (R 4.3.0)
 pillar                 1.9.0     2023-03-22 [1] CRAN (R 4.3.0)
 pkgbuild               1.4.2     2023-06-26 [1] CRAN (R 4.3.0)
 pkgconfig              2.0.3     2019-09-22 [1] CRAN (R 4.3.0)
 pkgload                1.3.2.1   2023-07-08 [1] CRAN (R 4.3.0)
 plyr                   1.8.8     2022-11-11 [1] CRAN (R 4.3.0)
 png                    0.1-8     2022-11-29 [1] CRAN (R 4.3.0)
 prettyunits            1.1.1     2020-01-24 [1] CRAN (R 4.3.0)
 processx               3.8.2     2023-06-30 [1] CRAN (R 4.3.0)
 profvis                0.3.8     2023-05-02 [1] CRAN (R 4.3.0)
 progress               1.2.2     2019-05-16 [1] CRAN (R 4.3.0)
 promises               1.2.0.1   2021-02-11 [1] CRAN (R 4.3.0)
 ps                     1.7.5     2023-04-18 [1] CRAN (R 4.3.0)
 purrr                * 1.0.1     2023-01-10 [1] CRAN (R 4.3.0)
 R6                     2.5.1     2021-08-19 [1] CRAN (R 4.3.0)
 rappdirs               0.3.3     2021-01-31 [1] CRAN (R 4.3.0)
 Rcpp                   1.0.11    2023-07-06 [1] CRAN (R 4.3.0)
 RCurl                  1.98-1.12 2023-03-27 [1] CRAN (R 4.3.0)
 readr                  2.1.4     2023-02-10 [1] CRAN (R 4.3.0)
 remotes                2.4.2.1   2023-07-18 [1] CRAN (R 4.3.0)
 restfulr               0.0.15    2022-06-16 [1] CRAN (R 4.3.0)
 rfishbase            * 4.1.2     2023-06-02 [1] CRAN (R 4.3.0)
 rgbif                * 3.7.7.2   2023-08-08 [1] Github (ropensci/rgbif@3bdfdb2)
 rjson                  0.2.21    2022-01-09 [1] CRAN (R 4.3.0)
 rlang                  1.1.1     2023-04-28 [1] CRAN (R 4.3.0)
 rmarkdown              2.23      2023-07-01 [1] CRAN (R 4.3.0)
 Rsamtools              2.16.0    2023-06-04 [1] Bioconductor
 RSQLite                2.3.1     2023-04-03 [1] CRAN (R 4.3.0)
 rstudioapi             0.15.0    2023-07-07 [1] CRAN (R 4.3.0)
 rtracklayer            1.60.0    2023-05-08 [1] Bioconductor
 rvest                  1.0.3     2022-08-19 [1] CRAN (R 4.3.0)
 S4Arrays               1.0.5     2023-07-30 [1] Bioconductor
 S4Vectors            * 0.38.1    2023-05-08 [1] Bioconductor
 scales                 1.2.1     2022-08-20 [1] CRAN (R 4.3.0)
 sessioninfo            1.2.2     2021-12-06 [1] CRAN (R 4.3.0)
 shiny                  1.7.4.1   2023-07-06 [1] CRAN (R 4.3.0)
 stringi                1.7.12    2023-01-11 [1] CRAN (R 4.3.0)
 stringr                1.5.0     2022-12-02 [1] CRAN (R 4.3.0)
 SummarizedExperiment   1.30.2    2023-06-11 [1] Bioconductor
 tibble                 3.2.1     2023-03-20 [1] CRAN (R 4.3.0)
 tidyselect             1.2.0     2022-10-10 [1] CRAN (R 4.3.0)
 tidyxl               * 1.0.8     2022-09-01 [1] CRAN (R 4.3.0)
 tzdb                   0.4.0     2023-05-12 [1] CRAN (R 4.3.0)
 urlchecker             1.0.1     2021-11-30 [1] CRAN (R 4.3.0)
 usethis                2.2.2     2023-07-06 [1] CRAN (R 4.3.0)
 utf8                   1.2.3     2023-01-31 [1] CRAN (R 4.3.0)
 vctrs                  0.6.3     2023-06-14 [1] CRAN (R 4.3.0)
 whisker                0.4.1     2022-12-05 [1] CRAN (R 4.3.0)
 xfun                   0.39      2023-04-20 [1] CRAN (R 4.3.0)
 XML                    3.99-0.14 2023-03-19 [1] CRAN (R 4.3.0)
 xml2                   1.3.5     2023-07-06 [1] CRAN (R 4.3.0)
 xtable                 1.8-4     2019-04-21 [1] CRAN (R 4.3.0)
 XVector                0.40.0    2023-05-08 [1] Bioconductor
 yaml                   2.3.7     2023-01-23 [1] CRAN (R 4.3.0)
 zlibbioc               1.46.0    2023-05-08 [1] Bioconductor

 [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library

──────────────────────────────────────────────────────────────────────────────

4. Using {xfun}

From Yihui Xie’s Introduction to {xfun} page:

…it is rarely useful to print out the names of base R packages, or information about the matrix products / BLAS / LAPACK. Often times I want additional information in the session information, such as the Pandoc version when rmarkdown is used.

What do you get? Basically utils::sessionInfo() but no matrix products, BLAS or LAPACK info, plus all the packages are listed together with their version numbers. You also can’t see where the package came from (CRAN, GitHub or Bioconductor). It lacks some human-readability compared to the functions in {devtools} and {sessioninfo}, but is clearly enough for Yihui – his package contains ‘miscellaneous functions that [he] use[s] by [him]self from time to time’.

Click to expand the output from this function
xfun::session_info()
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.2.1


Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8

time zone: Europe/London
tzcode source: internal

Package version:
  abind_1.4-5                 AnnotationDbi_1.62.2       
  ape_5.7.1                   askpass_1.1                
  assertthat_0.2.1            backports_1.4.1            
  base64enc_0.1.3             BH_1.81.0.1                
  Biobase_2.60.0              BiocFileCache_2.8.0        
  BiocGenerics_0.46.0         BiocIO_1.10.0              
  BiocParallel_1.34.2         biomaRt_2.56.1             
  Biostrings_2.68.1           bit_4.0.5                  
  bit64_4.0.5                 bitops_1.0-7               
  blob_1.2.4                  bold_1.3.0                 
  brew_1.0.8                  brio_1.1.3                 
  bslib_0.5.0                 cachem_1.0.8               
  callr_3.7.3                 checkmate_2.2.0            
  cli_3.6.1                   clipr_0.8.0                
  cluster_2.1.4               codetools_0.2-19           
  colorspace_2.1-0            commonmark_1.9.0           
  compiler_4.3.1              conditionz_0.1.0           
  contentid_0.0.17            cpp11_0.4.5                
  crayon_1.5.2                credentials_1.3.2          
  crul_1.4.0                  curl_5.0.1                 
  data.table_1.14.8           DBI_1.1.3                  
  dbplyr_2.3.3                DelayedArray_0.26.7        
  desc_1.4.2                  devtools_2.4.5             
  diffobj_0.3.5               digest_0.6.33              
  downlit_0.4.3               dplyr_1.1.2                
  duckdb_0.8.1.1              ellipsis_0.3.2             
  evaluate_0.21               fansi_1.0.4                
  farver_2.1.1                fastmap_1.1.1              
  fastmatch_1.1.3             filelock_1.0.2             
  fontawesome_0.5.1           foreach_1.5.2              
  foreign_0.8.84              formatR_1.14               
  Formula_1.2.5               fs_1.6.3                   
  futile.logger_1.4.3         futile.options_1.0.1       
  generics_0.1.3              GenomeInfoDb_1.36.1        
  GenomeInfoDbData_1.2.10     GenomicAlignments_1.36.0   
  GenomicFeatures_1.52.1      GenomicRanges_1.52.0       
  gert_1.9.3                  ggplot2_3.4.2              
  gh_1.4.0                    gitcreds_0.1.2             
  glue_1.6.2                  graphics_4.3.1             
  grDevices_4.3.1             grid_4.3.1                 
  gridExtra_2.3               gtable_0.3.3               
  helminthR_1.0.10            highr_0.10                 
  Hmisc_5.1.0                 hms_1.1.3                  
  htmlTable_2.4.1             htmltools_0.5.5            
  htmlwidgets_1.6.2           httpcode_0.3.0             
  httpuv_1.6.11               httr_1.4.6                 
  httr2_0.2.3                 igraph_1.5.0.1             
  ini_0.3.1                   IRanges_2.34.1             
  isoband_0.2.7               iterators_1.0.14           
  jquerylib_0.1.4             jsonlite_1.8.7             
  KEGGREST_1.40.0             knitr_1.43.1               
  labeling_0.4.2              lambda.r_1.2.4             
  later_1.3.1                 lattice_0.21-8             
  lazyeval_0.2.2              lifecycle_1.0.3            
  magrittr_2.0.3              MASS_7.3.60                
  Matrix_1.6-0                MatrixGenerics_1.12.3      
  matrixStats_1.0.0           memoise_2.0.1              
  methods_4.3.1               mgcv_1.9.0                 
  mime_0.12                   miniUI_0.1.1.1             
  munsell_0.5.0               natserv_1.0.0              
  nlme_3.1.162                nnet_7.3.19                
  oai_0.4.0                   openssl_2.1.0              
  parallel_4.3.1              pbapply_1.7.2              
  phangorn_2.11.1             pillar_1.9.0               
  piton_1.0.0                 pkgbuild_1.4.2             
  pkgconfig_2.0.3             pkgdown_2.0.7              
  pkgload_1.3.2.1             plogr_0.2.0                
  plyr_1.8.8                  png_0.1-8                  
  praise_1.0.0                prettyunits_1.1.1          
  processx_3.8.2              profvis_0.3.8              
  progress_1.2.2              promises_1.2.0.1           
  ps_1.7.5                    purrr_1.0.1                
  quadprog_1.5.8              R6_2.5.1                   
  ragg_1.2.5                  rappdirs_0.3.3             
  ratelimitr_0.4.1            rcmdcheck_1.4.0            
  RColorBrewer_1.1.3          Rcpp_1.0.11                
  RCurl_1.98-1.12             readr_2.1.4                
  rematch2_2.1.2              remotes_2.4.2.1            
  rentrez_1.2.3               restfulr_0.0.15            
  rex_1.2.1                   rfishbase_4.1.2            
  rgbif_3.7.7.2               Rhtslib_2.2.0              
  ritis_1.0.0                 rjson_0.2.21               
  rlang_1.1.1                 rmarkdown_2.23             
  rncl_0.8.7                  rotl_3.1.0                 
  roxygen2_7.2.3              rpart_4.1.19               
  rprojroot_2.0.3             rredlist_0.7.1             
  Rsamtools_2.16.0            RSQLite_2.3.1              
  rstudioapi_0.15.0           rtracklayer_1.60.0         
  rversions_2.1.2             rvest_1.0.3                
  S4Arrays_1.0.5              S4Vectors_0.38.1           
  sass_0.4.7                  scales_1.2.1               
  selectr_0.4.2               sessioninfo_1.2.2          
  shiny_1.7.4.1               snow_0.4.4                 
  solrium_1.2.0               sourcetools_0.1.7.1        
  splines_4.3.1               stats_4.3.1                
  stats4_4.3.1                stringi_1.7.12             
  stringr_1.5.0               SummarizedExperiment_1.30.2
  sys_3.4.2                   systemfonts_1.0.4          
  taxize_0.9.100              testthat_3.1.10            
  textshaping_0.3.6           tibble_3.2.1               
  tidyr_1.3.0                 tidyselect_1.2.0           
  tidyxl_1.0.8                tinytex_0.45               
  tools_4.3.1                 triebeard_0.4.1            
  tzdb_0.4.0                  urlchecker_1.0.1           
  urltools_1.7.3              usethis_2.2.2              
  utf8_1.2.3                  utils_4.3.1                
  uuid_1.1.0                  vctrs_0.6.3                
  viridis_0.6.4               viridisLite_0.4.2          
  vroom_1.6.3                 waldo_0.5.1                
  whisker_0.4.1               WikidataQueryServiceR_1.0.0
  WikidataR_2.3.3             WikipediR_1.5.0            
  wikitaxa_0.4.0              withr_2.5.0                
  wk_0.7.3                    worrms_0.4.3               
  xfun_0.39                   XML_3.99-0.14              
  xml2_1.3.5                  xopen_1.0.0                
  xtable_1.8-4                XVector_0.40.0             
  yaml_2.3.7                  zip_2.3.0                  
  zlibbioc_1.46.0             zoo_1.8.12                 

Conclusion

Yep, they basically do the same thing with slight differences. I personally like the idea of having some kind of table-like output for easy readability, so I’ll probably go with {devtools} as I often have it loaded anyway.

Environment

Session info
Last rendered: 2023-08-08 12:48:07 BST
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.2.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/London
tzcode source: internal

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] GenomicFeatures_1.52.1 AnnotationDbi_1.62.2   Biobase_2.60.0        
 [4] GenomicRanges_1.52.0   GenomeInfoDb_1.36.1    IRanges_2.34.1        
 [7] S4Vectors_0.38.1       BiocGenerics_0.46.0    helminthR_1.0.10      
[10] rgbif_3.7.7.2          rfishbase_4.1.2        tidyxl_1.0.8          
[13] purrr_1.0.1            dplyr_1.1.2           

loaded via a namespace (and not attached):
  [1] DBI_1.1.3                   bitops_1.0-7               
  [3] remotes_2.4.2.1             biomaRt_2.56.1             
  [5] rlang_1.1.1                 magrittr_2.0.3             
  [7] matrixStats_1.0.0           compiler_4.3.1             
  [9] RSQLite_2.3.1               callr_3.7.3                
 [11] png_0.1-8                   vctrs_0.6.3                
 [13] profvis_0.3.8               rvest_1.0.3                
 [15] stringr_1.5.0               pkgconfig_2.0.3            
 [17] crayon_1.5.2                fastmap_1.1.1              
 [19] ellipsis_0.3.2              dbplyr_2.3.3               
 [21] XVector_0.40.0              fontawesome_0.5.1          
 [23] utf8_1.2.3                  promises_1.2.0.1           
 [25] Rsamtools_2.16.0            rmarkdown_2.23             
 [27] sessioninfo_1.2.2           tzdb_0.4.0                 
 [29] ps_1.7.5                    bit_4.0.5                  
 [31] xfun_0.39                   zlibbioc_1.46.0            
 [33] cachem_1.0.8                jsonlite_1.8.7             
 [35] progress_1.2.2              blob_1.2.4                 
 [37] later_1.3.1                 DelayedArray_0.26.7        
 [39] BiocParallel_1.34.2         parallel_4.3.1             
 [41] prettyunits_1.1.1           R6_2.5.1                   
 [43] stringi_1.7.12              rtracklayer_1.60.0         
 [45] pkgload_1.3.2.1             Rcpp_1.0.11                
 [47] SummarizedExperiment_1.30.2 knitr_1.43.1               
 [49] usethis_2.2.2               readr_2.1.4                
 [51] httpuv_1.6.11               Matrix_1.6-0               
 [53] tidyselect_1.2.0            rstudioapi_0.15.0          
 [55] abind_1.4-5                 yaml_2.3.7                 
 [57] miniUI_0.1.1.1              codetools_0.2-19           
 [59] processx_3.8.2              curl_5.0.1                 
 [61] pkgbuild_1.4.2              lattice_0.21-8             
 [63] tibble_3.2.1                plyr_1.8.8                 
 [65] shiny_1.7.4.1               KEGGREST_1.40.0            
 [67] evaluate_0.21               urlchecker_1.0.1           
 [69] BiocFileCache_2.8.0         xml2_1.3.5                 
 [71] Biostrings_2.68.1           pillar_1.9.0               
 [73] filelock_1.0.2              MatrixGenerics_1.12.3      
 [75] whisker_0.4.1               generics_0.1.3             
 [77] RCurl_1.98-1.12             hms_1.1.3                  
 [79] ggplot2_3.4.2               munsell_0.5.0              
 [81] scales_1.2.1                xtable_1.8-4               
 [83] glue_1.6.2                  lazyeval_0.2.2             
 [85] tools_4.3.1                 BiocIO_1.10.0              
 [87] data.table_1.14.8           GenomicAlignments_1.36.0   
 [89] fs_1.6.3                    XML_3.99-0.14              
 [91] grid_4.3.1                  devtools_2.4.5             
 [93] colorspace_2.1-0            GenomeInfoDbData_1.2.10    
 [95] restfulr_0.0.15             cli_3.6.1                  
 [97] rappdirs_0.3.3              fansi_1.0.4                
 [99] S4Arrays_1.0.5              gtable_0.3.3               
[101] oai_0.4.0                   digest_0.6.33              
[103] rjson_0.2.21                htmlwidgets_1.6.2          
[105] memoise_2.0.1               htmltools_0.5.5            
[107] lifecycle_1.0.3             httr_1.4.6                 
[109] mime_0.12                   bit64_4.0.5                

Reuse

CC BY-NC-SA 4.0