All examples By author By category About

timelyportfolio

R CRAN meta visualized with parsetR htmlwidget

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.