Package 'adjustedcranlogs'

Title: Remove Automated and Repeated Downloads from 'RStudio' 'CRAN' Download Logs
Description: Adjusts output of 'cranlogs' package to account for 'CRAN'-wide daily automated downloads and re-downloads caused by package updates.
Authors: Tyler Morgan-Wall [aut, cre]
Maintainer: Tyler Morgan-Wall <[email protected]>
License: MIT + file LICENSE
Version: 0.2.0
Built: 2024-10-30 02:44:06 UTC
Source: https://github.com/tylermorganwall/adjustedcranlogs

Help Index


Adjusted Cran Downloads

Description

Removes daily shared downloads amongst CRAN packages and re-download/CRAN mirror spikes associated with package updates. The function samples a number of packages from the CRAN and finds the minimum

Usage

adj_cran_downloads(
  packages,
  when,
  from,
  to,
  remove_update_spikes = TRUE,
  number_to_compare = 100,
  value_quantile = NULL
)

Arguments

packages

A character vector, the packages to query.

when

last-day, last-week or last-month. If this is given, then from and to are ignored.

from

Start date, in yyyy-mm-dd format, or last-day. It is ignored if when is given.

to

End date, in yyyy-mm-dd format, or last-day. It is ignored if when is given.

remove_update_spikes

Default 'TRUE'. Removes the spike in downloads due to automatic re-downloads and CRAN mirrors associated with a package update. This replaces the number of downloads on an update day and the day following with the median download value across the measurement period. You can set this to 'FALSE' if you do not see spikes in downloads on days before or after you update to accurately capture downloads during those days.

number_to_compare

Default '100'. The number of random packages to inspect to determine the minimum number of downloads in any single day.

value_quantile

Default 'NULL'. By default, the function uses the minimum number of downloads. Setting a number here (between 0 and 1) instead returns the nth lowest number of downloads, where n = 'value_quantile' * 'number_to_compare'.

Value

A data frame of downloads and total downloads by package.

date

Day of the downloads, it is a Date object.

package

The package. This column is missing if all packages were queried.

count

Raw download count.

total_downloads

Raw total number of downloads from beginning of measurement period.

mindownloads

Estimated CRAN-wide automated downloads for that day.

updateday

TRUE if the package was updated that day, FALSE otherwise.

adjusted_downloads

Daily download count, adjusted.

adjusted_total_downloads

Adjusted total number of downloads from beginning of measurement period.

Examples

## Not run: adj_cran_downloads("skpr",from="2017-08-15",to="2017-11-15")
adj_cran_downloads("skpr",when="last-month")
adj_cran_downloads(c("skpr","AlgDesign"),when="last-month")
## End(Not run)