Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(dplyr)
- library(ggplot2)
- library(lubridate)
- library(cranlogs)
- library(hrbrthemes)
- dl <-
- cran_downloads(
- package = c("bomrang", "GSODR", "getCRUCLdata", "nasapower", "hagis"),
- from = "2016-09-01"
- )
- plot_data <-
- dl %>%
- mutate(date = as.Date(date)) %>%
- mutate(ym = format(date, '%Y-%m')) %>%
- mutate(ym = ymd(ym, truncated = 1))
- ggplot(plot_data, aes(x = date, y = count, group = package)) +
- geom_area(aes(colour = package,
- fill = package)) +
- guides(fill = FALSE, color = FALSE) +
- xlab("Year - Month") +
- ylab("Daily Downloads") +
- labs(
- title = "R package daily downloads",
- caption = paste0(
- "There have been ",
- summarise(dl, sum(count)),
- " total downloads.\n",
- "Source: RStudio Cloud Server CRAN Mirror"
- )
- ) +
- scale_fill_ft() +
- scale_colour_ft() +
- facet_wrap(package ~ ., scales = "free_y") +
- theme_ft_rc()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement