Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

try_transform_as_r_file

Style a file as if it was an .R file


Description

If not successful, the file is most likely not a .R file, so saving the file and try styling again will work if the file is an .Rmd file. Otherwise, we can throw an error that the file must be a .R or .Rmd file.

Usage

try_transform_as_r_file(context, transformer)

Arguments

context

The context from styler:::get_rstudio_context().

transformer

A transformer function most conveniently constructed with make_transformer().


styler

Non-Invasive Pretty Printing of R Code

v1.4.1
MIT + file LICENSE
Authors
Kirill Müller [aut], Lorenz Walthert [cre, aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.