Friday, August 26, 2016

Tracking CRAN package downloads and connectivity

I recently discovered this method of visualizing past & future CRAN downloads by Péter Sólymos. The following is a highly simplied version showing only past CRAN downloads:

library(cranlogs)
daily.downloads<-function(pkg,from="2013-08-27",to="2016-08-26"){
    obj<-cran_downloads(pkg,from=from,to=to)
    attach(obj)
    plot(count~date,type="l",col="grey",
        ylim=c(0,quantile(count,0.99)),
        ylab=paste("daily downloads (",pkg,")",sep=""))
    lines(lowess(date,count),col="red",lwd=2)
    title(main=pkg)
    detach(obj)
    invisible(obj)
}

Naturally (and my apologies for the narcissism involved here), I had to apply it to phytools:

daily.downloads("phytools")

plot of chunk unnamed-chunk-2

Here are some other popular R phylogenetics packages:

daily.downloads("ape")

plot of chunk unnamed-chunk-3

daily.downloads("phangorn")

plot of chunk unnamed-chunk-3

daily.downloads("geiger")

plot of chunk unnamed-chunk-3

and less-popular ones, like our Rphylip package:

daily.downloads("Rphylip")

plot of chunk unnamed-chunk-4

Note that (and not with specific reference to Rphylip by any means) some excellent packages are not as often downloaded, simply because they perform highly specialized analyses or because they have dependency relationships with relatively few other packages.

BTW, here is a plot made with the package miniCRAN (itself using igraph) which summarizes the dependency packages of a given library (that is, the packages on which it depends or imports from, not the reverse):

library(miniCRAN)
obj<-makeDepGraph("phytools",enhances=TRUE)
plot(obj,legendPosition=c(-1,1),vertex.size=20,cex=0.6)

plot of chunk unnamed-chunk-5

2 comments:

  1. Hi Liam,
    I would assume that Rphylip is less uploaded as it is also less frequently updated and people will have already the newest version.
    Klaus

    ReplyDelete
    Replies
    1. Good point. I guess I need to update phytools more frequently!

      Delete