Skip to contents

Download daily downloads stats from CRAN for any package, and plot. It can also be used as an auxiliary function to plot (cranlogs::cran_downloads) results.

Usage

cran_logs(
  input = "lares",
  from = Sys.Date() - 31,
  to = Sys.Date() - 1,
  type = "daily",
  plot = TRUE
)

Arguments

input

Character vector with package names or data.frame product of cranlogs::cran_downloads.

from, to

Dates. Range of dates to fetch downloads metrics.

type

Character. Any of: "daily" or "total".

plot

Boolean. Create a plot?

Value

List with data.frame and plot if plot=TRUE.

Examples

# \donttest{
cran_logs(c("lares", "dplyr"), from = "2021-05-31")
#> $df
#> # A tibble: 2,866 × 3
#>    date       count package
#>    <date>     <int> <chr>  
#>  1 2025-05-03    49 lares  
#>  2 2025-05-03 35555 dplyr  
#>  3 2025-05-01    61 lares  
#>  4 2025-05-01 47149 dplyr  
#>  5 2025-04-30    89 lares  
#>  6 2025-04-30 60185 dplyr  
#>  7 2025-04-29   126 lares  
#>  8 2025-04-29 65676 dplyr  
#>  9 2025-04-28   147 lares  
#> 10 2025-04-28 73103 dplyr  
#> # ℹ 2,856 more rows
#> 
#> $plot

#> 
# }