Different sessionInfo() output on Mac cli vs. RStudio

Viewed 16

When running sessionInfo() in Rstudio I get

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.5.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

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

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

loaded via a namespace (and not attached):
 [1] lubridate_1.8.0  fansi_1.0.3      assertthat_0.2.1 utf8_1.2.2       dplyr_1.0.10     R6_2.5.1         DBI_1.1.3        lifecycle_1.0.2  magrittr_2.0.3  
[10] pillar_1.8.1     stringi_1.7.8    rlang_1.0.5      cli_3.4.0        rstudioapi_0.14  snakecase_0.11.0 vctrs_0.4.1      generics_0.1.3   tools_4.2.1     
[19] stringr_1.4.1    glue_1.6.2       purrr_0.3.4      janitor_2.1.0    compiler_4.2.1   pkgconfig_2.0.3  tidyselect_1.1.2 tibble_3.1.8    

When running the same on an R-session started in the terminal via R I get

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur ... 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

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

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

loaded via a namespace (and not attached):
[1] compiler_4.2.1

As you can see the outputs differ:

  • RStudio says it's Monterey (which is correct), cli says it's Big Sur.
  • BLAS is missing
  • different packages are loaded via namespace

Both use the same .libPaths(). There's only one R in the path at /usr/local/bin/R.

This behaviour occurs on two different Macs, both with Monterey and R 4.2.1.

So why are the sessions different?

1 Answers

The running component is a copy of the utils::osVersion variable value. As explained in ?sessionInfo, that is set to the value used when R was compiled, which is typically 10.16 on Intel Macs.

Presumably RStudio and R.app replace that value with a correct one when run, but command line R doesn't.

If you build R yourself under Monterey, you'll see the correct value.

Regarding the packages loaded: RStudio loads a bunch of packages to support its API.

Regarding BLAS: I don't know, but it could be similar to the running issue, i.e. the front-end changed it.

Related