Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Percentiles #16

Open
pbreheny opened this Issue Sep 3, 2016 · 2 comments

Comments

Projects
None yet
2 participants

pbreheny commented Sep 3, 2016

Feature request: I'm not sure how much work would be involved in implementing this, but I think it would be very useful to have a function to return percentiles for downloads, in order to be able to say things like "package X is in the top 10% of downloaded packages from CRAN".

Owner

gaborcsardi commented Sep 3, 2016

Good idea. I don't think it is difficult to implement. You want to help with it? :)

A new SQL (plpgsql) procedure is needed here: https://github.com/metacran/cranlogs.app/blob/master/db/proc.sql

pbreheny commented Sep 4, 2016

Hmm...well, I'm not sure I know enough SQL/JSON to be of much help. Algorithmically, it would seem to require:

  1. Get names of all CRAN packages
  2. Run cran_downloads on that list
  3. Calculate quantiles

2 and 3 are straightforward. 1 is clearly possible, but I wouldn't know how to do it through the SQL/JSON interface. Or perhaps there's a more efficient approach than all this?

@gaborcsardi gaborcsardi referenced this issue in metacran/cranlogs.app Sep 5, 2016

Open

Percentiles #23

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