oneliner – a new style guide for styler

March 31, 2018
By

(This article was first published on Lorenz Walthert, and kindly contributed to R-bloggers)

I am happy to introduce oneliner, a package that implements the one-line-style as a third-party style guide ready to use with styler. Hence, after the tidyverse style guide, this is the first third-party style guide for styler I am aware of – and a particularly useful one.
Let’s see an example
# remotes::install_github("lorenzwalthert/oneliner") library(oneliner) style_text( "sum <- function(x, y) { x + # hi y } 1 + 1", style = one_line_style ) ## sum<-function(x,y){x+y};1+1 As you can guess from the name and the code above, the style guide has three rules only:

To leave a comment for the author, please follow the link and comment on their blog: Lorenz Walthert.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)