mikropml
package download
counts from cranlogs
library(cranlogs)
library(cowplot)
library(glue)
library(magick)
library(rsvg)
library(tidyverse)
downloads <- cran_downloads(package = "mikropml",
from = "2020-11-23") %>%
mutate(cum_count = cumsum(count))
write_csv(downloads, here::here('data', 'downloads.csv'))
tail(downloads)
#> date count package cum_count
#> 1340 2024-07-24 40 mikropml 19492
#> 1341 2024-07-25 7 mikropml 19499
#> 1342 2024-07-26 11 mikropml 19510
#> 1343 2024-07-27 1 mikropml 19511
#> 1344 2024-07-28 0 mikropml 19511
#> 1345 2024-07-29 0 mikropml 19511
badge_url <- "https://cranlogs.r-pkg.org/badges/grand-total/mikropml"
badge_img <- magick::image_read_svg(badge_url, width = 1000)
downloads_plot <- downloads %>%
ggplot(aes(date, cum_count)) +
geom_line(color = '#c882fc') +
scale_x_date(date_labels = "%b %Y") +
theme_bw() +
labs(x = '', y = 'downloads to date',
title = 'mikropml downloads from CRAN',
caption = glue("last updated: {Sys.Date()}"))
ggdraw() +
draw_plot(downloads_plot) +
draw_image(badge_img,
x = 0.99, y = 0.99,
hjust = 1, vjust = 1, halign = 1, valign = 1,
width = 0.15)
ggdraw() +
draw_plot(downloads_plot)