This package is based on https://github.com/lorenzwalthert/styler.yours
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}.
You can install the released version of {styler.equals} from GitHub with:
remotes::install_github("robinlovelace/styler.equals")
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
#> )