gather_cran: Gather CRAN details

Description Usage Arguments Details Examples

View source: R/cran_data.R

Description

Gather CRAN details

Usage

1
2
3
4
5

Arguments

pkg

(character) a package name

x

a data.frame

Details

While gather_commits and gather_downloads cache data because data can take a long time to download, this function shouldn't take that long, even with hundreds of of pkgs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
library("rostats")
library("ropkgs")
library("dplyr")
url <- "https://raw.githubusercontent.com/ropensci/roregistry/gh-pages/registry.json"
df <- jsonlite::fromJSON(url)
(pkgs <- tbl_df(df$packages) %>%
  filter(on_cran | on_bioc) %>%
  .$name)
sort(pkgs)

# get first date on CRAN for each pkg
res <- gather_crans(pkgs)
alldat <- dplyr::bind_rows(res)

# get new packages on CRAN, arranged by date
alldat %>% cran_first_date() %>% arrange(desc(date)) %>% top_n(10) %>%
  readr::write_csv("../biweekly/data/newpkgs.csv")

# get new packages & new versions on CRAN, arranged by date
alldat %>% arrange(desc(date)) %>% filter(date > '2019-04-14') %>% top_n(30) %>%
  readr::write_csv("../biweekly/data/newversions.csv")

## End(Not run)

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