roxygen2
based on object
propertiesR/roxygen_documentation.R
roxy_obj.Rd
This function gets a function and writes the skeleton of the documentation in roxygen syntax. The call of this function assumes that the working directory is a package directory, that is, where DESCRIPTION file is.
roxy_fun(object, file, export = TRUE, author, keywords, extra, editor, print = FALSE, append = FALSE, find_file = FALSE) roxy_data(object, file, source = NULL, keywords, author, extra, editor, print = FALSE, append = FALSE, find_file = FALSE)
object | An object that is a function. |
---|---|
file | character[1] An optional file name to write the
documentation into. If it is not provided, the name of the
function is used to name the file. If |
export | logical[1] If |
author | character[1] The author of the function to be assigned
to the |
keywords | character[>=1] Keywords to the function that will be
assigned to the |
extra | character[1] Additional information to be written, for
example |
editor | character[1] A name of an editor to open the file after
its creation. See |
logical[1] If |
|
append | logical[1] If |
find_file | logical[1] If |
source | character[1] A string that is the source of the
dataset. Only has effect for |
This function does not have return value. It only creates/modifies files and prints content.
# NOT RUN { #----------------------------------------- # Using roxy_fun(). fun <- function(x, y, ...) { return(x + y) } file.remove("bla.R") file.remove("fun.R") roxy_fun(fun) roxy_fun(fun, append = TRUE) file.remove("fun.R") roxy_fun(fun, find_file = TRUE) file.remove("fun.R") roxy_fun(fun, editor = "emacs") roxy_fun(fun, file = NA) file.remove("fun.R") roxy_fun(fun, print = TRUE) file.remove("fun.R") roxy_fun(fun, export = FALSE) file.remove("fun.R") roxy_fun(fun, author = "Walmes Zeviani, \\email{walmes@ufpr.br}.") roxy_fun(fun, file = "bla.R") file.remove("bla.R") roxy_fun(fun, file = "bla.R", extra = "@import lattice") file.remove("fun.R") roxy_fun(object = fun, editor = "emacs") # }# NOT RUN { #----------------------------------------- # Using roxy_data(). s <- "Smith; Sanders (1234)" file.remove("iris.R") roxy_data(iris, print = TRUE, source = s, editor = "emacs", keywords = c("BLA", "BLU"), find_file = TRUE, extra = c("@docType dataset", "@details bla bla bla")) # }