Skip to content

Instantly share code, notes, and snippets.

@fdavidcl
Created November 28, 2018 11:15
Show Gist options
  • Save fdavidcl/ef1c2073d732bf1a023e75964cbdd139 to your computer and use it in GitHub Desktop.
Save fdavidcl/ef1c2073d732bf1a023e75964cbdd139 to your computer and use it in GitHub Desktop.
Get a cumulative plot of Ruta downloads from the RStudio CRAN mirror
library(cranlogs)
library(purrr)
dat <- cran_downloads(from = "2018-05-08", packages = "ruta")
cumulative <- map_dbl(1:length(dat$count), ~ sum(dat$count[1:.]))
plot(cumulative ~ date, data = dat, type = "l")
@fdavidcl
Copy link
Author

Output is something like this:
downloads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment