Takes two package manifests (from manifest()) and classifies every
source package as missing, outdated, newer, or the same relative to the
target.
Arguments
- source_pkgs
data.tableordata.framefrommanifest(), representing the installation you are copying packages from.- target_pkgs
data.tableordata.framefrommanifest(), representing the installation you are copying packages into.
Value
A named list with the following elements:
missingPackages in source that are absent from target.
outdatedPackages where the source version is newer than the target version.
newerPackages where the target already has a newer version than the source.
samePackages at identical versions in both installations.
comparisonFull merged
data.tableof all source packages with astatuscolumn ("missing","outdated","newer", or"same").summaryOne-row
data.framewith counts:missing,outdated,newer,same,total_source.
Each data.table includes columns package, version.x (source
version), version.y (target version), and source.
Examples
src <- data.table::data.table(
package = c("dplyr", "ggplot2"),
version = c("1.1.4", "3.5.1"),
priority = NA_character_
)
tgt <- data.table::data.table(
package = "dplyr",
version = "1.0.0"
)
inventory(src, tgt)
#> $comparison
#> Key: <package>
#> package version.x priority.x source version.y priority.y target_source
#> <char> <char> <char> <char> <char> <char> <char>
#> 1: dplyr 1.1.4 <NA> <NA> 1.0.0 <NA> <NA>
#> 2: ggplot2 3.5.1 <NA> <NA> <NA> <NA> <NA>
#> status
#> <char>
#> 1: outdated
#> 2: missing
#>
#> $missing
#> package version.x priority.x source version.y priority.y target_source
#> <char> <char> <char> <char> <char> <char> <char>
#> 1: ggplot2 3.5.1 <NA> <NA> <NA> <NA> <NA>
#> status
#> <char>
#> 1: missing
#>
#> $outdated
#> package version.x priority.x source version.y priority.y target_source
#> <char> <char> <char> <char> <char> <char> <char>
#> 1: dplyr 1.1.4 <NA> <NA> 1.0.0 <NA> <NA>
#> status
#> <char>
#> 1: outdated
#>
#> $newer
#> Empty data.table (0 rows and 8 cols): package,version.x,priority.x,source,version.y,priority.y...
#>
#> $same
#> Empty data.table (0 rows and 8 cols): package,version.x,priority.x,source,version.y,priority.y...
#>
#> $summary
#> missing outdated newer same total_source
#> 1 1 1 0 0 2
#>