This report shows trend of package downloads from omprehensive R Archive Network (CRAN).
library(cranlogs)
library(dplyr)
library(ggplot2)
library(kableExtra)
options(scipen = 999)
packages = c("ggplot2", "dplyr", "caret", "rmarkdown", "plyr", "tidyr")
df_month = cran_downloads(when = "last-month")
df_lastWeek = cran_downloads(when = "last-week", package = packages)
kable(df_month %>%
arrange(desc(count)) %>% head(5),
caption = "5 days with the most downloads in last month") %>%
kable_styling(bootstrap_options = c("striped", "condensed"), position = "center", font_size = 11)
5 days with the most downloads in last month
|
date
|
count
|
|
2020-01-08
|
4951405
|
|
2019-12-11
|
4872090
|
|
2020-01-09
|
4858602
|
|
2020-01-07
|
4659837
|
|
2019-12-12
|
4525945
|
ggplot(data = df_month, aes(x = date, y = count)) +
geom_line(color = "#00AFBB", size = 1) +
scale_x_date(limits = c(min(df_month$date),NA)) +
stat_smooth(
color = "#FC4E06", fill = "#FC4E07",
method = "loess") +
labs(title = "Downloads in the last month", subtitle = "Smoothed using 'loess' method") +
xlab("Dates") + ylab("Download Numbers") +
theme_minimal()

kable(df_lastWeek %>%
group_by(package) %>%
mutate(Total_DL = sum(count)) %>%
select(package, Total_DL) %>%
unique(),
caption = "Total Downloads in the Last Week for Selected Packages") %>%
kable_styling(bootstrap_options = c("striped", "condensed"), position = "center", font_size = 11)
Total Downloads in the Last Week for Selected Packages
|
package
|
Total_DL
|
|
ggplot2
|
205499
|
|
dplyr
|
236065
|
|
caret
|
45773
|
|
rmarkdown
|
171709
|
|
plyr
|
183976
|
|
tidyr
|
179403
|
ggplot(df_lastWeek, aes(date, count, colour = package)) +
geom_line() +
ylab("Download Numbers") +
labs(title = "Daily Downloads in the Last Week", subtitle = paste(c('Package Names: ', packages), collapse = " "))
