gather_downloads: Get CRAN downloads

Description Usage Arguments Value Examples

View source: R/gather_downloads.R

Description

Get CRAN downloads

Usage

1
2
gather_downloads(x, from = NULL, to = Sys.Date() - 1,
  file = Sys.Date())

Arguments

x

One or more R packages, of the form ropensci/rfishbase, case sensitive

from

(Date) A date to start from. Default is NULL, and we get the first date published on CRAN to start from using gather_cran and cran_first_date

to

(Date) A date to end at. Default: Sys.Date() - 1

file

A date, or other character string to make the file ending unique. Default: Sys.Date()

Value

writes a data.frame to rappdirs::user_cache_dir("rostats") + '/cran_downloads/', prints message of path to file, and returns file path itself

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
library("ropkgs")
library("dplyr")
df <- ro_pkgs()
pkgs <- tbl_df(df$packages) %>%
  filter(on_cran) %>%
  .$name %>%
  sort
pkgs <- sub("redland-bindings", "redland", pkgs)
gather_downloads(x = pkgs[1])
# gather_downloads(x = pkgs[1:3])
# gather_downloads(x = pkgs)

## End(Not run)

ropensci/rostats documentation built on Oct. 15, 2019, 1:37 p.m.