README.md

depcheck

R-CMD-check Lifecycle: experimental Codecov test coverage

The goal of {depcheck} is to provide an overview of the R packages used within a project, finds which functions have been called from the loaded packages, and includes a warning for any package that is seldom/never utilised.

Installation

devtools::install_github("ashbaldry/depcheck")

Usage

The 3 main functions in {depcheck}:

When printing the results, there are a few options to adjust what is classified as "low usage":

If a package fails all 3 conditions, then it will be included in the list of under utilised packages.

NB Base R packages, such as {utils} and {stats} will automatically be excluded from the low usage packages

Example

project_dependencies <- checkShinyDependencyUse("../reddit-analysis-app") # ashbaldry/reddit-analysis-app
summary(project_dependencies)
# Number of Declared Packages: 14
# Total Number of Dependencies: 85
# Declared Packages: utils, glue, httr, highcharter, scales, shiny.semantic, htmlwidgets, stringi, 
# quanteda, R6, data.table, shiny, promises, magrittr
# Function usage for 'glue', 'htmlwidgets', 'stringi', 'magrittr' are below the specified thresholds. 
# Print individual package summaries to check if packages can be removed

summary(project_dependencies$glue)
# Package: 'glue'
# Package Dependencies: 0
# Package Usage: 1 / 16 (6%)
# Functions Used: glue
# Function usage for 'glue' is below the specified thresholds. Consider copying used function to reduce dependencies


ashbaldry/depcheck documentation built on Jan. 1, 2022, 11:11 p.m.