Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/MangoTheCat/goodpractice

Advice on R Package Building
https://github.com/MangoTheCat/goodpractice

Last synced: 3 months ago
JSON representation

Advice on R Package Building

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, setup, include = FALSE}
#, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(
echo = TRUE,
comment = "#>",
tidy = FALSE,
error = FALSE,
fig.width = 8,
fig.height = 8)
```

# goodpractice


[![R-CMD-check](https://github.com/ropensci-review-tools/goodpractice/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci-review-tools/goodpractice/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/goodpractice)](https://CRAN.R-project.org/package=goodpractice)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/goodpractice)](https://www.r-pkg.org/pkg/goodpractice)
[![Codecov test coverage](https://codecov.io/gh/ropensci-review-tools/goodpractice/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropensci-review-tools/goodpractice?branch=main)

## Advice on R Package Building

Give advice about good practices when building R packages. Advice includes
functions and syntax to avoid, package structure, code complexity, code
formatting, etc.

## Installation

You can install the release version from CRAN

```{r eval = FALSE}
install.packages("goodpractice")
```

and the development version from GitHub

```{r eval = FALSE}
pak::pak("ropensci-review-tools/goodpractice")
```

## Usage

```r
library(goodpractice)
gp("")
```

## Example

```{r, message = FALSE, warning = FALSE}
library(goodpractice)
# use example package contained in the goodpractice package
pkg_path <- system.file("bad1", package = "goodpractice")
g <- gp(pkg_path)
g

# show all available checks
# all_checks()

# run only a specific check
g_url <- gp(pkg_path, checks = "description_url")
g_url

# which checks were carried out?
checks(g_url)

# which checks failed?
failed_checks(g)

# show the first 5 checks carried out and their results
results(g)[1:5,]
```

## License

MIT © 2022 Ascent Digital Services UK Limited