Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/r-lib/styler

Non-invasive pretty printing of R code
https://github.com/r-lib/styler

pretty-print r

Last synced: about 2 months ago
JSON representation

Non-invasive pretty printing of R code

Awesome Lists containing this project

README

        

---
output: github_document
editor_options:
markdown:
wrap: 79
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```

# {styler}: Non-Invasive Pretty Printing of R Code

[![R build status](https://github.com/r-lib/styler/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/styler/actions)
[![Lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![Test coverage](https://codecov.io/gh/r-lib/styler/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/styler?branch=main)
[![CRAN Status](https://www.r-pkg.org/badges/version/styler)](https://cran.r-project.org/package=styler)

# Overview

styler formats your code according to the [tidyverse style
guide](https://style.tidyverse.org) (or your custom style guide) so you can
direct your attention to the content of your code. It helps to keep the coding
style consistent across projects and facilitate collaboration. You can access
styler through

- the RStudio Addin as demonstrated below
- R functions like `style_pkg()`, `style_file()` or `style_text()`
- various other tools described in `vignette("third-party-integrations")`

```{r, out.width = "650px", echo = FALSE}
knitr::include_graphics("https://raw.githubusercontent.com/lorenzwalthert/some_raw_data/master/styler_0.1.gif")
```

## Installation

You can install the package from CRAN.

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

Or get the development version from GitHub:

```{r, eval = FALSE}
# install.packages("remotes")
remotes::install_github("r-lib/styler")
```

## Documentation

The following online docs are available:

- [latest CRAN release](https://styler.r-lib.org).

- [GitHub development version](https://styler.r-lib.org/dev/).

## Acknowledgments

Hex sticker font is [Gayathri](https://fonts.google.com/specimen/Gayathri), and
the image is taken from icon made by [Freepik](https://www.freepik.com) and
available at [flaticon.com](https://www.flaticon.com/free-icon/suit).