Skip to contents

Compare lock files

Usage

compare_lock(x)

Arguments

x

A list of lists or list of 'rt_tibble'. An output from read_lock().

Value

A tibble with following columns:
a,b: Labels for first and second lockfile compared
a_rver,b_rver: R versions for the lock files compared
a_renvver,b_renvver: renv package versions
jaccard: Jaccard's index. 0 meaning no packages are shared and 1 meaning all packages are shared between lock files
a_pkgs_len,b_pkgs_len: Number of packages
a_pkgs_len_unique,b_pkgs_len_unique: Number of pkgs only in first or second lock file
pkgs_total_len: Number of pkgs combining first and second lock files
a_pkgs,b_pkgs: A list of character vector of pkg names in first and second lock files
a_pkgs_unique,b_pkgs_unique: A list of character vector of unique packages in first or second lock files
pkgs_common: A list of character vector of pkgs shared between the two lock files (intersect)
pkgs_total: A list of character vector of all pkgs in the two lock files (union)

Examples

paths <- c(
  file.path(system.file("extdata", package = "renvtools"), "renv-r4.4.1.lock"),
  file.path(system.file("extdata", package = "renvtools"), "renv-r4.3.2.lock")
)
l <- read_lock(paths, format = "list")
compare_lock(l)
#> # A tibble: 1 x 18
#>   a     b     a_rver b_rver a_renvver b_renvver jaccard a_pkgs_len b_pkgs_len
#>   <chr> <chr> <chr>  <chr>  <chr>     <chr>       <dbl>      <int>      <int>
#> 1 lf_1  lf_2  4.4.1  4.3.2  1.0.7     1.0.3       0.432        294        668
#> # i 9 more variables: a_pkgs_len_unique <int>, b_pkgs_len_unique <int>,
#> #   pkgs_total_len <int>, a_pkgs <list>, b_pkgs <list>, a_pkgs_unique <list>,
#> #   b_pkgs_unique <list>, pkgs_common <list>, pkgs_total <list>