itdepends (version 0.0.0.9000)

dep_weight: Calculate the package weight

Description

Calculate the package weight

Usage

dep_weight(packages, repos = c(CRAN = "https://cloud.r-project.org"),
  when = "last-week")

Arguments

packages

Packages to weigh

repos

The CRAN or CRAN-like repo to use

when

last_day, last_week or last_month. If this is given, then from and to are ignored.

Value

- funs - If you compare the # of exported funs vs the number of function you import / use in your package it gives you some idea of how much work it would take to remove the dependency. e.g. if you use 50 functions from dplyr you would have to replicate 1/5 of more of the functionality from dplyr to remove the dependency, if you only use 1-5 functions maybe it is more tractable

But for packages like rcmdcheck or glue that only have a few functions you will have to replicate a larger proportion of the package even if you only import one function

It also gives you some idea of the API size, which can give you an idea how likely it is to change in the future

Examples

Run this code
# NOT RUN {
  dep_weight(c("dplyr", "data.table"))
# }

Run the code above in your browser using DataLab