Creates roxygen2 skeleton including title, description, import and other fields for an object in the global environment or a function of an attached namespace.

makeOxygen(
  obj,
  add_default = TRUE,
  add_fields = sinew_opts$get("add_fields"),
  use_dictionary = NULL,
  print = TRUE,
  ...
)

Arguments

obj

function or name of function

add_default

boolean to add defaults values to the end of the PARAM fields, Default: TRUE

add_fields

character vector to add additional roxygen2 fields, Default: c("details","examples","seealso","rdname","export")

use_dictionary

character, path_to_dictionary, Default: NULL

print

boolean print output to console, Default: TRUE

...

arguments to be passed to make_import

Details

add_fields can include any slot except for the defaults (title,description,param,return). The order in add_fields determines the order of printout. The roxygen2 fields to add are list below, for more information go to Generating Rd files. If obj is 'data.frame' or 'tibble' then the fields c('export','examples','seealso','rdname') will be ignored.

FieldSkeleton
authorAUTHOR [AUTHOR_2]
backrefsrc/filename.cpp
conceptCONCEPT_TERM_1 [CONCEPT_TERM_2]
describeInFUNCTION_NAME DESCRIPTION
detailsDETAILS
examplepath/relative/to/packge/root
export
familyFAMILY_TITLE
fieldFIELD_IN_S4_RefClass DESCRIPTION
formatDATA_STRUCTURE
importClassesFromPKG CLASS_a [CLASS_b]
importMethodsFromPKG METHOD_a [METHOD_b]
includeFILENAME.R [FILENAME_b.R]
inherit[PKG::]SOURCE_FUNCTION [FIELD_a FIELD_b]
inheritDotParams[PKG::]SOURCE_FUNCTION
inheritSection[PKG::]SOURCE_FUNCTION [SECTION_a SECTION_b]
keywordsKEYWORD_TERM
nameNAME
rdnameFUNCTION_NAME
referencesBIB_CITATION
sectionSECTION_NAME
source\url{http://somewhere.important.com/}
slotSLOTNAME DESCRIPTION
templateFILENAME
templateVarNAME VALUE
useDynLibPKG [routine_a routine_b]

Examples

makeOxygen(stats::lm)
#> #' @title FUNCTION_TITLE #> #' @description FUNCTION_DESCRIPTION #> #' @param formula PARAM_DESCRIPTION #> #' @param data PARAM_DESCRIPTION #> #' @param subset PARAM_DESCRIPTION #> #' @param weights PARAM_DESCRIPTION #> #' @param na.action PARAM_DESCRIPTION #> #' @param method PARAM_DESCRIPTION, Default: 'qr' #> #' @param model PARAM_DESCRIPTION, Default: TRUE #> #' @param x PARAM_DESCRIPTION, Default: FALSE #> #' @param y PARAM_DESCRIPTION, Default: FALSE #> #' @param qr PARAM_DESCRIPTION, Default: TRUE #> #' @param singular.ok PARAM_DESCRIPTION, Default: TRUE #> #' @param contrasts PARAM_DESCRIPTION, Default: NULL #> #' @param offset PARAM_DESCRIPTION #> #' @param ... PARAM_DESCRIPTION #> #' @return OUTPUT_DESCRIPTION #> #' @details DETAILS #> #' @examples #> #' \dontrun{ #> #' if(interactive()){ #> #' #EXAMPLE1 #> #' } #> #' } #> #' @seealso #> #' \code{\link[stats]{model.frame}} #> #' @rdname stats::lm #> #' @export #> #' @importFrom stats model.frame