ropensci-review-tools / pkgstats

Historical statistics of every R package ever
https://docs.ropensci.org/pkgstats/
17 stars 1 forks source link

[BUG] package names in external calls not properly resolved #33

Closed mpadge closed 2 years ago

mpadge commented 2 years ago
library (pkgstats)
packageVersion ("pkgstats")
#> [1] '0.0.3.51'
u <- "https://cran.r-project.org/src/contrib/adepro_3.2.0.tar.gz"
tarball <- tail (strsplit (u, "\\/") [[1]], 1L)
f <- file.path (tempdir (), tarball)
download.file (u, f)
s <- pkgstats (f)
ss <- pkgstats_summary (s)
ss [["external_calls"]]
#> [1] "!rlang:15:1,adepro:34:18,base:335:61,dplyr:28:6,graphics:30:9,grDevices:5:1,methods:6:1,readr:8:2,seriation:4:2,shiny:41:17,shinyWidgets:2:2,stats:8:5,tidyr:5:2,utils:11:2"

ex <- s$external_calls
table (ex$package)
#> 
#>       !rlang       adepro         base        dplyr     graphics    grDevices 
#>           15           34          335           28           30            5 
#>      methods        readr    seriation        shiny shinyWidgets        stats 
#>            6            8            4           41            2            8 
#>        tidyr        utils 
#>            5           11

Created on 2021-12-03 by the reprex package (v2.0.1.9000)

!rlang should be rlang.

mpadge commented 2 years ago

Also this:

library (pkgstats)
packageVersion ("pkgstats")
#> [1] '0.0.3.51'
u <- "https://cran.r-project.org/src/contrib/yuima_1.9.6.tar.gz"
tarball <- tail (strsplit (u, "\\/") [[1]], 1L)
f <- file.path (tempdir (), tarball)
download.file (u, f)
s <- pkgstats (f)
ss <- pkgstats_summary (s)
ss [["external_calls"]]
#> [1] ":1:1,base:6029:153,glassoFast:1:1,graphics:95:6,lattice:18:2,MASS:2:1,Matrix:3:1,methods:230:7,stats:453:50,utils:125:5,yuima:990:434"

ex <- s$external_calls
table (ex$package)
#> 
#>                  base glassoFast   graphics    lattice       MASS     Matrix 
#>          1       6029          1         95         18          2          3 
#>    methods      stats      utils      yuima 
#>        230        453        125        990

Created on 2021-12-03 by the reprex package (v2.0.1.9000)

package name is missing for that first entry.