fnmate_fn.R: fnmate_fn.R

View source: R/fnmate.R

fnmate_fn.RR Documentation

fnmate_fn.R

Description

Create a definition in file for the function used at index.

Usage

fnmate_fn.R(text, index)

Arguments

text

some text from a source file

index

an index into text indicating the cursor position.

Details

Given some text and an index into the text, this function creates a new file containing a definition for the function used at the index. The file name is the same as the function. An error is thrown if no function is found.

By default the function is created in the './R' folder. This can be changed with the 'fnmate_folder' option.

By default the function body contains only NULL. This can be changed with the 'fnmate_placeholder' option.

This function is not intended to be used directly but by the fnmate front end - either Emacs or RStudio.

Value

Nothing, file created as side effect.

Author(s)

Miles McBain


MilesMcBain/fnmate documentation built on March 1, 2025, 1:26 p.m.