line_assign: Wraps a line of code within a function in assign()

Description Usage Arguments Value See Also Examples

Description

This function is used to assign expressions within a function to a value of your choice. It can be used with line_insert() to modify what a function returns, add additional conditional statements, and add more to already existing functions.

Usage

1
line_assign(.f, line, assign_to)

Arguments

.f

A non-primitive function

line

An expression from the body of the function

assign_to

The name of the variable to assign to, as a string

Value

function

See Also

line_remove line_insert

Examples

1
2
new_map <- line_assign(strwidth, line = 3, assign_to = 'abc')
line_insert(new_map, after_line = 4, quote(return(abc)))

visuelledata/frite documentation built on May 17, 2019, 1:30 p.m.