Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mlr-org/styler.mlr
{styler} mlr style guide
https://github.com/mlr-org/styler.mlr
Last synced: 6 days ago
JSON representation
{styler} mlr style guide
- Host: GitHub
- URL: https://github.com/mlr-org/styler.mlr
- Owner: mlr-org
- License: other
- Created: 2021-04-09T08:58:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-05T16:02:41.000Z (7 days ago)
- Last Synced: 2024-11-05T17:19:23.742Z (7 days ago)
- Language: R
- Size: 159 KB
- Stars: 4
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# styler.mlr
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/mlr-org/styler.mlr/workflows/R-CMD-check/badge.svg)](https://github.com/mlr-org/styler.mlr/actions)The goal of {styler.mlr} is format code according to the [mlr style](https://github.com/mlr-org/mlr3/wiki/Style-Guide). It is an example for a
custom [{styler}](https://styler.r-lib.org) style guide.## Installation
You can install the released version of {styler.mlr} from [GitHub](https://github.com) with:
``` r
remotes::install_github("mlr-org/styler.mlr")
```## Example
This is a basic example of how to style code with it.
```{r example}
library(styler.mlr)
cache_deactivate()
text = "x <- 4
y = 3
a;
"style_text(text)
```To use the `mlr-style` in the RStudio addin, one can put something like this into `.Rprofile`:
```{r}
if (grepl("mlr", getwd()) || grepl("paradox", getwd())) {
options(styler.addins_style_transformer = "styler.mlr::mlr_style()")
}
```