Skip to content

A style for equals assignment, based on the styler package

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

Robinlovelace/styler.equals

Repository files navigation

styler.equals

This package is based on https://github.com/lorenzwalthert/styler.yours

Lifecycle: experimental R-CMD-check

The goal of {styler.equals} is to provide an implementation of the ‘equals style’ used by Yuhei Xie, Colin Gillespie and many in the #rspatial community.

So far it basically just the ‘tidyverse style’ but with equals assignment. In the future it may evolve, e.g. to implement the Geocomputation with R style guide.

It is a third-party style guide for {styler}.

Installation

You can install the released version of {styler.equals} from GitHub with:

remotes::install_github("robinlovelace/styler.equals")

Example

This is a basic example of how to style code with it.

library(styler.equals)
cache_deactivate()
#> Deactivated cache.
text = "x <- 4
y = 3
a;
"

text_styled_equals = style_text(text)
text_styled_equals
#> x = 4
#> y = 3
#> a

A more complicated example showing that it also fixes other issues from the styler package is:

style_text("a=2", scope = "tokens")
#> a = 2
style_text("a=2", scope = I(c("tokens", "indention")))
#> a=2
style_text(
  "tibble::tibble(
     small  = 2 ,
     medium = 4,#comment without space
     large  = 6
   )"
)
#> tibble::tibble(
#>   small  = 2,
#>   medium = 4, # comment without space
#>   large  = 6
#> )

About

A style for equals assignment, based on the styler package

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages