Skip to content

Commit

Permalink
update README to show get_cran() refresh
Browse files Browse the repository at this point in the history
also update  the data in the metrics_table example, add Colin as contributor
  • Loading branch information
sfirke committed Dec 10, 2017
1 parent 56bc890 commit 927cee6
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 6 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Expand Up @@ -6,7 +6,9 @@ Authors@R: c(person("Sam", "Firke", email = "samuel.firke@gmail.com", role = c("
person("Erin", "Grand", email = "eringrand@gmail.com", role = "aut"),
person("Lori", "Shepherd", email = "lori.shepherd@roswellpark.org", role = "aut"),
person("William","Ampeh", email = "wampeh@gmu.edu", role = "aut"),
person("Hannah", "Frick", email = "hannah.frick@gmail.com", role = "aut"))
person("Hannah", "Frick", email = "hannah.frick@gmail.com", role = "aut"),
person("Gillespie", "Colin", email = "csgillespie+github@gmail.com", role = "ctb"))

Description: This package was designed to address two issues, 78 and 69, for the ROpenSci unconf17 concerning avoiding redundant / overlapping packages and a framework for reproducible tables. As this is a complex topic, the smaller tasks being accomplished is producing a list of metrics that can be used to compare similar packages utilizing information collected from CRAN, GitHub, and StackOverflow.
Depends: R (>= 3.4.0)
Imports:
Expand Down
20 changes: 18 additions & 2 deletions README.Rmd
Expand Up @@ -22,12 +22,22 @@ devtools::install_github("ropenscilabs/packagemetrics")

## Use

### Here's an example using a case study of popular table-making packages.
**Comparing dplyr and data.table:**

```{r, echo=TRUE}
library(packagemetrics)
library(dplyr)
pkg_df <- package_list_metrics(table_packages)
dplyr_and_dt <- package_list_metrics(c("dplyr", "data.table"))
glimpse(dplyr_and_dt)
```

### Creating a pretty metrics_table

Here's a comparison of popular table-making packages, using the `metrics_table` function:

```{r, echo = TRUE}
pkg_df <- package_list_metrics(table_packages) # included vector of table pkgs
ft <- metrics_table(pkg_df)
```

Expand All @@ -41,6 +51,12 @@ webshot::webshot(url,
delay = 0.2)
```

## Refreshing data sources

If the cached CRAN data gets out of date, call `get_cran(forget = TRUE)` to force refreshing. This will fetch the latest results from CRAN and cache them for use going forward.

GitHub data is scraped at the time of the call to `package_list_metrics`.

## Requirements

```packagemetrics``` requires R version >= 3.4.0.
44 changes: 41 additions & 3 deletions README.md
Expand Up @@ -21,16 +21,54 @@ devtools::install_github("ropenscilabs/packagemetrics")
Use
---

### Here's an example using a case study of popular table-making packages.
**Comparing dplyr and data.table:**

``` r
library(packagemetrics)
library(dplyr)

pkg_df <- package_list_metrics(table_packages)
dplyr_and_dt <- package_list_metrics(c("dplyr", "data.table"))
glimpse(dplyr_and_dt)
```

## Observations: 2
## Variables: 18
## $ package <chr> "dplyr", "data.table"
## $ published <chr> "2017-09-28", "2017-10-27"
## $ title <chr> "A Grammar of Data Manipulation", "Extensio...
## $ depends_count <int> 1, 1
## $ suggests_count <int> 17, 18
## $ tidyverse_happy <lgl> TRUE, FALSE
## $ has_vignette_build <lgl> TRUE, TRUE
## $ has_tests <lgl> TRUE, TRUE
## $ reverse_count <int> 677, 377
## $ dl_last_month <dbl> 393520, 286717
## $ ci <chr> "Travis, Appveyor", "NONE"
## $ test_coverage <chr> "CodeCov", NA
## $ forks <dbl> 836, 650
## $ stars <dbl> 2097, 1253
## $ watchers <dbl> 236, 156
## $ last_commit <dbl> 0.66666667, 0.06666667
## $ last_issue_closed <dbl> 0.06666667, 0.10000000
## $ contributors <dbl> 136, 43

### Creating a pretty metrics\_table

Here's a comparison of popular table-making packages, using the `metrics_table` function:

``` r
pkg_df <- package_list_metrics(table_packages) # included vector of table pkgs
ft <- metrics_table(pkg_df)
```

![](README_files/figure-markdown_github-ascii_identifiers/unnamed-chunk-2-1.png)
![](README_files/figure-markdown_github/unnamed-chunk-3-1.png)

Refreshing data sources
-----------------------

If the cached CRAN data gets out of date, call `get_cran(forget = TRUE)` to force refreshing. This will fetch the latest results from CRAN and cache them for use going forward.

GitHub data is scraped at the time of the call to `package_list_metrics`.

Requirements
------------
Expand Down
Binary file modified inst/image/table.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 927cee6

Please sign in to comment.