[R-pkg-devel] Analysing namespace reverse dependencies

Gábor Csárdi c@@rd|@g@bor @end|ng |rom gm@||@com
Sat Mar 9 18:30:59 CET 2019


https://github.com/r-lib/pkgapi has map_package() which will list all
the functions of a package, where they were defined, and also all
function calls, internal ones and calls to external packages as well:

map <- pkgapi::map_package("~/works/processx")
names(map)
#> [1] "name"    "exports" "defs"    "calls"

head(map$calls, 3)
#>               file        from                 to type
#> 1 R/aaassertthat.R assert_that base::parent.frame call
#> 2 R/aaassertthat.R assert_that   processx::see_if call
#> 3 R/aaassertthat.R assert_that       base::return call
#>   line1 line2 col1 col2          str
#> 1     2     2   36   47 parent.frame
#> 2     3     3   10   15       see_if
#> 3     4     4   12   17       return

Because of the dynamic nature of the language, some false negatives,
and maybe even false positives might happen.

Gabor

On Sat, Mar 9, 2019 at 2:06 PM Roger Bivand <Roger.Bivand using nhh.no> wrote:
>
> Hi,
>
> Is anyone aware of tools permitting the listing of functions in the
> namespace of package A used by package B when package B declares that it
> depends on A, suggests A, or imports(A) without specifying the functions
> from A that B is using? If B imports functions from A, and uses
> importsFrom() in its NAMESPACE, the information can be recovered by
> inspecting its NAMESPACE file (assuming that the entries are correct), but
> not otherwise.
>
> Grateful for any pointers,
>
> Roger
>
> --
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
> https://orcid.org/0000-0003-2392-6140
> https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list