Download logs from the RStudio CRAN mirror

RStudio publishes the download logs from their CRAN package mirror daily at http://cran-logs.rstudio.com.

This R package queries a web API maintained by R-hub that contains the daily download numbers for each package.

The RStudio CRAN mirror is not the only CRAN mirror, but it’s a popular one: it’s the default choice for RStudio users. The actual number of downloads over all CRAN mirrors is unknown.

Installation

You can install cranlogs from CRAN:

install.packages("cranlogs")

Or get the development version from Github:

Usage

It has a very simple API. By default it shows the total number of package downloads from the last day for which data is available.

The last week (6 days prior to the last day for which data is available), or the last month (29 days prior to the last day for which data is available) can be also easily queried:

cran_downloads(when = "last-week")

The package argument queries a specific package:

cran_downloads(when = "last-week", package = c("magrittr", "dplyr"))

Alternative intervals can also be specified:

cran_downloads(package = "plyr", from = "2014-01-01", to = "2014-02-01")

For downloads of R itself, give "R" instead of a package:

#>          date      version  os count
#> 1  2019-06-03       2.11.0 osx     1
#> 2  2019-06-03       2.12.2 osx     1
#> 3  2019-06-03       2.13.1 osx     1
#> 4  2019-06-03       2.13.2 osx     4
#> 5  2019-06-03       2.15.1 osx     1
#> 6  2019-06-03        3.0.1 osx     1
#> 7  2019-06-03        3.0.2 osx     1
#> 8  2019-06-03        3.0.3 osx     1
#> 9  2019-06-03        3.1.1 osx     1
#> 10 2019-06-03        3.2.0 osx     1
#> 11 2019-06-03        3.2.1 osx     4
#> 12 2019-06-03        3.2.4 osx     1
#> 13 2019-06-03        3.3.0 osx     1
#> 14 2019-06-03        3.3.2 osx     1
#> 15 2019-06-03        3.3.3 osx    63
#> 16 2019-06-03        3.4.0 osx     1
#> 17 2019-06-03        3.4.1 osx     2
#> 18 2019-06-03        3.4.3 osx     1
#> 19 2019-06-03        3.4.4 osx    39
#> 20 2019-06-03        3.5.0 osx     3
#> 21 2019-06-03        3.5.1 osx     3
#> 22 2019-06-03        3.5.2 osx     8
#> 23 2019-06-03        3.5.3 osx    67
#> 24 2019-06-03        3.6.0 osx   601
#> 25 2019-06-03       latest osx   378
#> 26 2019-06-03       2.12.0 src     1
#> 27 2019-06-03       2.15.0 src     2
#> 28 2019-06-03        3.1.2 src     2
#> 29 2019-06-03        3.1.3 src     1
#> 30 2019-06-03        3.2.1 src     2
#> 31 2019-06-03        3.2.5 src     1
#> 32 2019-06-03        3.3.0 src     2
#> 33 2019-06-03        3.3.2 src     1
#> 34 2019-06-03        3.3.3 src     2
#> 35 2019-06-03        3.4.0 src     1
#> 36 2019-06-03        3.4.1 src     8
#> 37 2019-06-03        3.4.2 src     9
#> 38 2019-06-03        3.4.3 src     1
#> 39 2019-06-03        3.4.4 src     2
#> 40 2019-06-03        3.5.0 src     6
#> 41 2019-06-03        3.5.1 src    33
#> 42 2019-06-03        3.5.2 src     6
#> 43 2019-06-03        3.5.3 src     7
#> 44 2019-06-03        3.6.0 src    96
#> 45 2019-06-03       2.13.2 win     1
#> 46 2019-06-03        3.2.1 win     3
#> 47 2019-06-03        3.2.5 win     3
#> 48 2019-06-03        3.3.0 win     1
#> 49 2019-06-03        3.3.1 win     1
#> 50 2019-06-03        3.3.2 win     1
#> 51 2019-06-03        3.3.3 win    55
#> 52 2019-06-03        3.4.0 win     1
#> 53 2019-06-03        3.4.2 win     2
#> 54 2019-06-03        3.4.3 win    13
#> 55 2019-06-03        3.4.4 win    22
#> 56 2019-06-03        3.5.0 win     3
#> 57 2019-06-03        3.5.1 win     2
#> 58 2019-06-03        3.5.2 win     4
#> 59 2019-06-03        3.5.3 win    99
#> 60 2019-06-03        3.6.0 win  3281
#> 61 2019-06-03 3.6.0patched win   355
#> 62 2019-06-03        devel win   126