Skip to content

Conversation

Cervangirard
Copy link
Collaborator

Just noting a few tests :

use_renv Default is FALSE. If your project does have a lock file, then set to TRUE to get list of R packages. If not using a lock file and just want to get list of R packages from current sessionInfo(), then set to FALSE.

lockfile_loc Default is NULL. If use_renv is set to TRUE, then set this to the path of your lockfile.

> list_r_packages(use_renv = TRUE, lockfile_loc = "./renv.lock")
              Package Version                                                                      Title
R6                 R6   2.5.1                              Encapsulated Classes with Reference Semantics
admiral       admiral  0.10.1                                                    ADaM in R Asset Library
admiraldev admiraldev   0.3.0     Utility Functions and Development Tools for the Admiral Package Family
cli               cli   3.6.0                             Helpers for Developing Command Line Interfaces
cpp11           cpp11   0.4.3                                      A C++11 Interface for R's C Interface
dplyr           dplyr   1.1.0                                             A Grammar of Data Manipulation
ellipsis     ellipsis   0.3.2                                                 Tools for Working with ...
fansi           fansi   1.0.4                               ANSI Control Sequence Aware String Functions
generics     generics   0.1.3 Common S3 Generics not Provided by Base R Methods Related to Model Fitting
glue             glue   1.6.2                                                Interpreted String Literals
hms               hms   1.1.2                                                         Pretty Time of Day
lifecycle   lifecycle   1.0.3                            Manage the Life Cycle of your Package Functions
lubridate   lubridate   1.9.2                                    Make Dealing with Dates a Little Easier
magrittr     magrittr   2.0.3                                              A Forward-Pipe Operator for R
pillar         pillar   1.8.1                                            Coloured Formatting for Columns
pkgconfig   pkgconfig   2.0.3                                     Private Configuration for 'R' Packages
purrr           purrr   1.0.1                                               Functional Programming Tools
renv             renv   1.1.4                                                       Project Environments
rlang           rlang   1.1.0               Functions for Base Types and Core R and 'Tidyverse' Features
stringi       stringi  1.7.12                   Fast and Portable Character String Processing Facilities
stringr       stringr   1.5.0                   Simple, Consistent Wrappers for Common String Operations
tibble         tibble   3.2.0                                                         Simple Data Frames
tidyr           tidyr   1.3.0                                                            Tidy Messy Data
tidyselect tidyselect   1.2.0                                               Select from a Set of Strings
timechange timechange   0.2.0                                       Efficient Manipulation of Date-Times
utf8             utf8   1.2.3                                                    Unicode Text Processing
vctrs           vctrs   0.5.2                                                             Vector Helpers
withr           withr   2.5.0                          Run Code 'With' Temporarily Modified Global State
> list_r_packages(use_renv = FALSE, lockfile_loc = NULL)
      Package Version                                              Title
1 BiocManager 1.30.25 Access the Bioconductor Project Package Repository
2    compiler   4.4.3                             The R Compiler Package
3       tools   4.4.3                      Tools for Package Development
4        renv   1.1.4                               Project Environments
[1] "Base Packages:"
    Package Version                                                    Title
1     stats   4.4.3                                      The R Stats Package
2  graphics   4.4.3                                   The R Graphics Package
3 grDevices   4.4.3 The R Graphics Devices and Support for Colours and Fonts
4  datasets   4.4.3                                   The R Datasets Package
5     utils   4.4.3                                      The R Utils Package
6   methods   4.4.3                               Formal Methods and Classes
7      base   4.4.3                                       The R Base Package
[1] "All Packages (Base and Loaded):"
       Package Version                                                    Title
1  BiocManager 1.30.25       Access the Bioconductor Project Package Repository
2     compiler   4.4.3                                   The R Compiler Package
3        tools   4.4.3                            Tools for Package Development
4         renv   1.1.4                                     Project Environments
5        stats   4.4.3                                      The R Stats Package
6     graphics   4.4.3                                   The R Graphics Package
7    grDevices   4.4.3 The R Graphics Devices and Support for Colours and Fonts
8     datasets   4.4.3                                   The R Datasets Package
9        utils   4.4.3                                      The R Utils Package
10     methods   4.4.3                               Formal Methods and Classes
11        base   4.4.3                                       The R Base Package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants