knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of semicoloner is format code according to one rule: Put a semi-colon after every expression. It is an example for a custom {styler} style guide.
You can install the released version of semicoloner from CRAN with:
remotes::install_github("lorenzwalthert/semicoloner")
This is a basic example which shows you how to solve a common problem:
library(semicoloner) cache_deactivate() text <- 'communicate_warning <- function(changed, transformers) { if (any(changed, na.rm = TRUE) && !can_verify_roundtrip(transformers) && !getOption("styler.quiet", FALSE) ) { cat("Please review the changes carefully!", fill = TRUE) } } a b c / 3 d + 3 ' style_text(text)
purrr::partial()
style guide
arguments with third-party style guide.more_args
and transformer_drop
in create_style_guide()
.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.