r-hub / cranlogs

Download Logs from the RStudio CRAN Mirror
https://r-hub.github.io/cranlogs/
Other
80 stars 13 forks source link

aggregate counts by package over a period #57

Open adfi opened 4 years ago

adfi commented 4 years ago

We can get aggregate counts for all packages over a period and counts by date for specific packages. That is great but can we also get aggregate counts by package over a period? I know it's a simple aggregation we can do as well but it would save downloading a million records.

Something like:

cran_downloads(package = 'cranlogs', from='2020-01-01', to='2020-03-14', aggregate=TRUE)

This probably would require a change in the API for it to be an actual saving. Let me know what you think.

gaborcsardi commented 4 years ago

I think there is an API for this, actually: https://github.com/r-hub/cranlogs.app#total-downloads-over-a-period-downloadstotalperiodpackage1package2

Would you like to send a PR?

adfi commented 4 years ago

Sure, I can have a look.