Generate roxygen2 Style R Files

Usage

new_r(fun, path = "R", file.name = NULL)

Arguments

fun
A function or character string naming the function.
path
Path to directory to generate the function test in. Default is to use "R" for ease of use within RStudio.
file.name
By default the file is named the same as fun + ".R". This can be changed by supplying a file name to file.name.

Generate <span class = "pkg">roxygen2</span> Style R Files

Generate <span class = "pkg">roxygen2</span> Style R Files

Value

Generates a ‘____.R’ file.

Description

Quickly produce a roxygen2 style.R’ template file from a function (output file will include the function) or a character string.

Examples

dir.create("temp_dir") new_r(paste, "temp_dir")
R file created: temp_dir/paste.R
new_r("myfun", "temp_dir")
R file created: temp_dir/myfun.R
unlink("temp_dir", TRUE, TRUE)