block by timelyportfolio 1065889dff6643d2c4d6

R CRAN meta visualized with parsetR htmlwidget

Full Screen

Visualized CRAN Meta

This week’s parsetR htmlwidget offers an interactive view of categorical data. Since Gabor Csardi has put much so much effort into metacran, we can get a helpful look at CRAN metadata such as download count (thx RStudio), maintainer, and license in only a couple of lines of code.

Code

I’d love for you to reproduce and extend.

# devtools::install_github("metacran/cranlogs")
# devtools::install_github("metacran/crandb)
# devtools::install_github("timelyportfolio/parsetR")
library(cranlogs)
library(crandb)
library(dplyr)
library(parsetR)

cran_top_downloads("last-month",count=20) %>%
  group_by(package) %>%
  do(
    {
      cran_meta <- package(.$package)
      data.frame(
        .,
        maintainer = gsub(
          x=cran_meta$Maintainer,
          pattern="( <.*>)",
          replacement=""
        ),
        license = cran_meta$License
      )
    }
  ) %>%
  ungroup %>%
  data.frame %>%
  parset(
    dimensions = c("maintainer","license","package"),
    value = htmlwidgets::JS("function(d){return d.count}")
  )

Example

View the live example.

code.R