Skip to content
Prev 3861 / 12125 Next

[R-pkg-devel] Package dependency graphs of packages in development (local)

You can do something like this with https://github.com/r-lib/pkgdepends:

pr <- pkgdepends::remotes()$new("local::.", library = tempfile())
#> ? Creating library directory:
`/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T//Rtmpo5NL9R/filee95427c73f55`

pr$solve()
#> ? Checking for package metadata updates
#> ? All 10 metadata files are current.
#> ? Using session cached package metadata
#> ? Using cached package metadata
#> PKG SOLUTION, 1 refs, resolved in 1.2s, solved in 193ms
???????????????????????
#>   local::.
#> Dependencies:
#>   github:
#>     r-lib/crancache, r-lib/rcmdcheck
#>   standard:
#>     askpass, assertthat, backports, base64enc, bit, bit64, blob, callr,
#>     cli, clisymbols, cranlike, crayon, curl, DBI, debugme, desc,
#>     digest, evaluate, fansi, glue, gmailr, highr, hms, httr, jsonlite,
#>     knitr, magrittr, markdown, memoise, mime, openssl, parsedate,
#>     pillar, pkgbuild, pkgconfig, prettyunits, processx, progress, ps,
#>     R6, rappdirs, Rcpp, rematch2, remotes, rlang, rprojroot, RSQLite,
#>     sessioninfo, stringi, stringr, sys, tibble, utf8, whoami, withr,
#>     xfun, xopen, yaml

tibble::as_tibble(pr$get_solution()$data)
#> # A tibble: 61 x 27
#>    ref   type  direct status package version license
needscompilation priority
#>    <chr> <chr> <lgl>  <chr>  <chr>   <chr>   <chr>   <lgl>            <chr>
#>  1 loca? local TRUE   OK     revdep? 1.0.0.? MIT + ? NA               NA
#>  2 askp? stan? FALSE  OK     askpass 1.1     NA      FALSE            NA
#>  3 asse? stan? FALSE  OK     assert? 0.2.1   NA      FALSE            NA
#>  4 back? stan? FALSE  OK     backpo? 1.1.4   NA      FALSE            NA
#>  5 base? stan? FALSE  OK     base64? 0.1-3   NA      FALSE            NA
#>  6 bit64 stan? FALSE  OK     bit64   0.9-7   NA      FALSE            NA
#>  7 bit   stan? FALSE  OK     bit     1.1-14  NA      FALSE            NA
#>  8 blob  stan? FALSE  OK     blob    1.1.1   NA      FALSE            NA
#>  9 callr stan? FALSE  OK     callr   3.2.0   NA      FALSE            NA
#> 10 cli   stan? FALSE  OK     cli     1.1.0   NA      FALSE            NA
#> # ? with 51 more rows, and 18 more variables: md5sum <chr>, sha256 <chr>,
#> #   filesize <int>, built <chr>, platform <chr>, rversion <chr>,
repodir <chr>,
#> #   target <chr>, deps <list>, mirror <chr>, sources <list>, remote <list>,
#> #   error <list>, metadata <list>, extra <list>, dep_types <list>,
#> #   cache_status <chr>, lib_status <chr>

And the `deps` column there shows the direct dependencies of the dependencies:

? pr$get_solution()$data$deps[1:2]
#> [[1]]
#> # A tibble: 25 x 5
#>    ref             type    package    op    version
#>    <chr>           <chr>   <chr>      <chr> <chr>
#>  1 assertthat      Imports assertthat ""    ""
#>  2 callr           Imports callr      ""    ""
#>  3 cli             Imports cli        ""    ""
#>  4 clisymbols      Imports clisymbols ""    ""
#>  5 r-lib/crancache Imports crancache  >=    0.0.0.9001
#>  6 crayon          Imports crayon     ""    ""
#>  7 DBI             Imports DBI        ""    ""
#>  8 desc            Imports desc       >=    1.1.1.9002
#>  9 glue            Imports glue       ""    ""
#> 10 gmailr          Imports gmailr     ""    ""
#> # ? with 15 more rows
#>
#> [[2]]
#> # A tibble: 2 x 5
#>   ref      type     package  op    version
#>   <chr>    <chr>    <chr>    <chr> <chr>
#> 1 testthat suggests testthat ""    ""
#> 2 sys      imports  sys      >=    2.1

Gabor
On Thu, May 9, 2019 at 8:53 AM Rainer M Krug <Rainer at krugs.de> wrote: