Collect Metrics about R Packages
This package is used to collect metrics about CRAN, BioConductor or other packages, for Valid-R.
remotes::install_github("mangothecat/packageMetrics2")
library(packageMetrics2)
See available metrics:
list_package_metrics()
#> ARR
#> "Number of times = is used for assignment"
#> ATC
#> "Author Test Coverage"
#> DWL
#> "Number of Downloads"
#> DEP
#> "Num of Dependencies"
#> DPD
#> "Number of Reverse-Dependencies"
#> CCP
#> "Cyclomatic Complexity"
#> FLE
#> "Average number of code lines per function"
#> FRE
#> "Date of First Release"
#> LIB
#> "Number of library and require calls"
#> LLE
#> "Number of code lines longer than 80 characters"
#> LNC
#> "Number of lines of compiled code"
#> LNR
#> "Number of lines of R code"
#> LRE
#> "Date of Last Release"
#> NAT
#> "Number of attach and detach calls"
#> NTF
#> "Number of times T/F is used instead of TRUE/FALSE"
#> NUP
#> "Updates During the Last 6 Months"
#> OGH
#> "Whether the package is on GitHub"
#> SAP
#> "Number of sapply calls"
#> SEM
#> "Number of trailing semicolons in the code"
#> SEQ
#> "Number of 1:length(vec) expressions"
#> SWD
#> "Number of setwd calls"
#> VIG
#> "Number of vignettes"
Calculate metrics for a named package:
metrics <- package_metrics("remotes")
#> Downloading remotes (latest)
#> Installing remotes (latest) and dependencies
#> Installing 1 packages: curl
#>
#> There is a binary version available (and will be installed) but
#> the source version is later:
#> binary source
#> curl 2.6 2.7
#>
#> package 'curl' successfully unpacked and MD5 sums checked
#> Metrics:
#> ARR
#> Preparing: lintr
#> ATC
#> DWL
#> DEP
#> DPD
#> CCP
#> FLE
#> FRE
#> LIB
#> LLE
#> LNC
#> LNR
#> LRE
#> NAT
#> NTF
#> NUP
#> OGH
#> SAP
#> SEM
#> SEQ
#> SWD
#> VIG
#>
head(metrics)
#> ARR ATC DWL
#> "0" "94.2539388322521" "69747"
#> DEP DPD CCP
#> "4" "2" "2.68939393939394"
MIT © Mango Solutions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.