Learn R Programming

summarytools (version 0.8.0)

parse_args: Extract Data Information From Arguments Passed to Functions

Description

Using sys.calls(), sys.frames() and match.call(), this utility function extracts and/or deducts information about the data being processed. Data frame name, variable names and labels if any, subsetting information, grouping information (when by() is used) are returned by the function which tries various methods to get this information.

Usage

parse_args(sys_calls, sys_frames, match_call, var = "x")

Arguments

sys_calls

Object created using sys.calls().

sys_frames

Object created using sys.frames().

match_call

Object created using match.call().

var

One of “x” or “y” (the latter being used only in ctable).

Value

A list comprised of:

  • df_name The data frame name when applicable.

  • var_names The variable names when applicable.

  • rows_subset The subsetting condition when applicable.

  • by_group The group, when functions are called through by()

  • by_first A binary indicator used when function was called through by()

  • by_last A binary indicator used when function was called through by()

Details

The default plain.ascii = TRUE option is there to make results appear cleaner in the console. To avoid markdown rendering problems, the option is automatically set to FALSE whenever style = 'rmarkdown', unless plain.ascii = TRUE is made explicit. If the intent is to produce rmarkdown text for further processing while using style = 'simple', set plain.ascii to FALSE.