This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(cranlogs) | |
library(ggplot2) | |
cran <- function(package, cumulative = FALSE, from = "2019-01-01") { | |
# Get downloads | |
mls <- cran_downloads(packages = package, from = from, to = Sys.Date() - 1) | |
if (cumulative == FALSE) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Get the month (or all days) of a calendar week | |
#' | |
#' @param week Atomic character vector. Specify the calendar week you want \cr | |
#' to have parsed. Must be of format 'YYYY-WW' (e.g., '2020-03'). | |
#' @param .df Logical. Defaults to FALSE. If TRUE, the function does not \cr | |
#' return a single integer vector with the month information but a \cr | |
#' data.frame with all days and dates of the chosen calendar week, including \cr | |
#' information on which month each day belongs to. | |
#' | |
#' @return Atomic integer vector containing the month to which the calendar week \cr |