RCode: Functions for creating representations of R code as text

Description Usage Arguments Value Author(s) Examples

View source: R/codeObjects.R

Description

These functions allow us to represent R objects which represent various types of R code, functions and methods. These also simplify indenting the code.

Usage

1
RCode(..., .txt = unlist(list(...)), indent = "", class = "RCode")

Arguments

...

character strings giving the text for the code

.txt

an alternative way to provide the strings for the code

indent

the string to prefix the text, i.e. indent.

class

the type of object. This allows us to use the same function to construct different types of objects

Value

An instance of class class containing the code as a single string concatenated togther with a new line character (\n).

Author(s)

Duncan Temple Lang

Examples

1
  RCode("if(is.null(x))", "   stop('x is null')", "x[[2]]")

omegahat/RGCCTranslationUnit documentation built on May 24, 2019, 1:53 p.m.