Learn R Programming

constructive (version 1.1.0)

construct_signature: Construct a function's signature

Description

Construct a function's signature such as the one you can see right below in the 'Usage' section.

Usage

construct_signature(x, name = NULL, one_liner = FALSE, style = TRUE)

Value

a string or a character vector, with a class "constructive_code" for pretty printing if style is TRUE

Arguments

x

A function

name

The name of the function, by default we use the symbol provided to x

one_liner

Boolean. Whether to collapse multi-line expressions on a single line using semicolons.

style

Boolean. Whether to give a class "constructive_code" on the output for pretty printing.

Examples

Run this code
construct_signature(lm)

Run the code above in your browser using DataLab