-
Notifications
You must be signed in to change notification settings - Fork 6
/
README.Rmd
64 lines (44 loc) · 2.28 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: "packagemetrics"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message=FALSE)
```
## About packagemetrics
The packagemetrics project was a part of the 2017 rOpenSci Unconference. With over 10,000 packages on CRAN - and thousands more on GitHub and Bioconductor - a useR needs a way to navigate this wealth of options. There are many existing tools that are helpful for finding packages, but few ways to quickly compare differences between packages. We set out to create tools for comparing a set of related and potentially overlapping packages through a combination of standardized packagemetrics and an expert review process. More information about our project can be found in this [post](https://ropensci.org/blog/blog/2017/06/27/packagemetrics).
rOpenSci migrated this package to Sam Firke's GitHub account in December 2020, where it currently lives with the minimal maintenance needed to keep it working.
## Team packagemetrics:
Lori Shepherd, Hannah Frick, William Ampeh, Erin Grand, Sam Firke, Becca Krouse
## Installation
```r
devtools::install_github("sfirke/packagemetrics")
```
## Use
**Comparing dplyr and data.table:**
```{r, echo=TRUE}
library(packagemetrics)
library(dplyr)
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)
```
```{r, echo=FALSE}
w <- formattable::as.htmlwidget(ft, width = 1200, height = NULL)
path <- htmltools::html_print(w, background = "white", viewer = NULL)
url <- paste0("file:///", gsub("\\\\", "/", normalizePath(path)))
webshot::webshot(url,
file = "inst/image/table.png",
selector = ".formattable_widget",
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.