Skip to content

Maybe we should plot up the most popular packages upon merge #180

@boshek

Description

@boshek
plot_task_view_downloads <- function(task_view) {
  ctv_data <- ctv::ctv(task_view)
  hydrology_pkgs <- ctv_data$packagelist$name

  last_month_downloads <- function(pkg) {
    downloads_by_day <- cranlogs::cran_downloads(pkg, when = "last-month")
    data.frame(
      package = pkg,
      count = sum(downloads_by_day$count)
    )
  }

  hydrology_pkg_downloads <- purrr::map_df(hydrology_pkgs, last_month_downloads)

  ggplot2::ggplot(hydrology_pkg_downloads, ggplot2::aes(y = forcats::fct_reorder(package, count), x = count)) +
    ggplot2::geom_col()
}

plot_task_view_downloads("Hydrology")
plot_task_view_downloads("Spatial")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions