Skip to content
Collect Metrics about R Packages
R Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
man
tests
.Rbuildignore
.gitignore
DESCRIPTION
LICENSE
Makefile
NAMESPACE
NEWS.md
README.Rmd
README.md

README.md

packageMetrics2

Collect Metrics about R Packages

Project Status: WIP: Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Travis-CI Build Status CRAN RStudio mirror downloads Coverage Status

This package is used to collect metrics about CRAN, BioConductor or other packages, for Valid-R.

Installation

remotes::install_github("mangothecat/packageMetrics2")

Usage

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"

License

MIT © Mango Solutions

You can’t perform that action at this time.