init_function: Create a new package function

View source: R/init_function.R

init_functionR Documentation

Create a new package function

Description

Create initial script and test files for a function that is to be added to a package.

Usage

init_function(name, dir = ".", overwrite = FALSE)

Arguments

name

Name of the function. Should start with the function's category, followed by a specific name, separated by an underscore ('_') (e.g., 'init_function').

dir

Path to the package's development directory; default is the current working directory.

overwrite

Logical; if TRUE, replaces existing files with templates.

Value

Creates files in dir/R and dir/tests/testthat, attempts to navigate to the code file, and returns a character vector to their paths.

Examples

## Not run: 

# creates a skeleton for a `measure_new` function
init_function("measure_new")

## End(Not run)

uva-bi-sdad/community documentation built on Oct. 12, 2023, 1:18 p.m.