Pretty Print R Code in the Terminal

Replace the standard print method for functions with one that performs syntax highlighting, using ANSI colors, if the terminal supports them.


Linux Build Status Windows Build status CRAN RStudio mirror downloads Coverage Status

Replace the standard print method for functions with one that performs syntax highlighting, using ANSI colors, if the terminal supports them.

Installation

source("https://install-github.me/r-lib/prettycode")

Usage

Just call prettycode::prettycode() and start printing functions to the screen. Long functions are automatically paged using the default pager.

License

MIT © Gábor Csárdi

News

1.0.2

  • Add prettycode::prettycode(). Call this function to turn on pretty-printing of function objects. This is needed to work around the new S3 method search limits in R 3.5.x.

  • If prettycode fails to highlight a function, it falls back to base::print.function() now (#3).

1.0.1

  • Avoid registering the print.function S3 method. This is needed to avoid a new R CMD check check

1.0.0

First public release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("prettycode")

1.0.2 by Gábor Csárdi, 2 months ago


https://github.com/r-lib/prettycode#readme


Report a bug at https://github.com/r-lib/prettycode/issues


Browse source code at https://github.com/cran/prettycode


Authors: Gábor Csárdi


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports crayon, utils, withr

Suggests covr, mockery, testthat


Imported by tracer.

Suggested by drake.


See at CRAN