Skip to contents

Apply pkgstats across the git history of a package

Usage

repo_pkgstats_history(path, step_days = 1L, num_cores = -1L)

Arguments

path

Path to local repository containing an R package.

step_days

Analyse package at intervals of this number of days. The last commit for each day is chosen. For example, step_days = 7L will return weekly statistics. Values of zero or less will analyse all commits, including potentially multiple daily commits.

num_cores

Number of cores to use in multi-core processing. Has no effect on Windows operating systems, on which calculations are always single-core only. Negative values are subtracted from number of available cores, determined as parallel::detectCores(), so default of num_cores = -1L uses detectCores() - 1L. Positive values use precisely that number, restricted to maximum available cores, and a value of zero will use all available cores.

Value

NULL if path is not an R package, or if no pkgstats results are able to be extracted. Otherwise, a list of three items:

  • desc_data Containing data from DESCRIPTION files, along with data on numbers of functions.

  • loc Containing data on "lines-of-code" for all languages and sub-directories within package.

  • stats Containing statistics on (mean, medium, and sum) of various properties of each function in package.