new_r: Generate 'roxygen2' Style R Files

Description Usage Arguments Value References See Also Examples

View source: R/new_r.R

Description

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

new_r_min - A minimal version of new_r that does not output \@seealso, \@keywords, \@references, or \@return.

Usage

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

new_r_min(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. Setting to TRUE copies just the roxygen2 code to the clipboard. Setting to NULL just prints the output to the console.

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.

Value

Generates a ‘____.R’ file.

References

http://r-pkgs.had.co.nz/man.html

See Also

Other new functions: new_data, new_r_test, new_test, new_vignette

Examples

1
2
3
4
dir.create("temp_dir")
new_r(paste, "temp_dir")
new_r("myfun", "temp_dir")
unlink("temp_dir", TRUE, TRUE)

trinker/pax documentation built on March 21, 2018, 3:01 a.m.