docr.describe_df: Build an RD formatted output of a dataframe object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/docr_describe_df.R

Description

docr.describe_df

Usage

1
2
docr.describe_df(df_in = NULL, make_interactive = FALSE,
  include_slice = FALSE)

Arguments

df_in

The data frame object to be documented

make_interactive

logical Should the columns of the data frame be additionally documented. If set to TRUE, this will create a prompted loop at the terminal, in which the column name will be printed, and the provided information can be typed for the column information. The info is then passed into the item description returned.

Details

This is a helper function that works similarly to promptData, but instead of returning an .RD formatted output file, this function cat's a preformatted roxygenized block of information for use in documenting a data frame. The intention of this function is that when an alternate or newly created function returns a data.frame object, this function can be used to easily document the @return code-block.

Value

A properly formatted roxygen block describing the data.frame in detail.

Author(s)

Carl S.A. Boneri, carl.boneri@whyles.com

See Also

Other Documentation functions: docr.author, docr.clean_fun, docr.defaults_prompt, docr.defaults, docr.example_df, docr.family, docr.fun, docr.has_defaults, docr.install_r_only, docr.make_license, docr.meta_private, docr.meta_public, docr.param

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# A data frame of all local RDS formatted files.

a <- dirs.get_r(find_pattern = ".rds$")

docr.describe_df(a, make_interactive = T)

#' \format{
#'   A data frame with 19 observations on the following 5 variables.
#'  \describe{
#'     \item{\strong{base_path}}{\emph{a character vector}
#'         The home path to the library location.}
#'     \item{\strong{lib_name}}{\emph{a character vector}
#'      The library name of the containing package or
#'      directory}
#'     \item{\strong{folder_path}}{\emph{a character vector}
#'       The sub folder paths, within the directory, in
#'        which the file is stored}
#'     \item{\strong{file_name}}{\emph{a character vector}
#'        The actual, basename of the file itself}
#'     \item{\strong{full_path}}{\emph{a character vector}
#'         The fully normalized path to the file, for use
#'         when sourcing or reading in from an external or
#'         alternate library.}
#'  }
#'}

docr.describe_df(a, make_interactive = F)

#' \format{
#'  A data frame with 19 observations on the following 5 variables.
#'  \describe{
#'    \item{\strong{base_path}}{\emph{a character vector}}
#'    \item{\strong{lib_name}}{\emph{a character vector}}
#'    \item{\strong{folder_path}}{\emph{a character vector}}
#'    \item{\strong{file_name}}{\emph{a character vector}}
#'    \item{\strong{full_path}}{\emph{a character vector}}
#'   }
#' }

CarlBoneri/roxydoc2 documentation built on Nov. 6, 2019, 8:01 a.m.