Handles a list or list of lists, converting to human-readable text format
Usage
handleArgsText(
argTextA,
name = "",
col1 = "mediumpurple2",
col2 = "mediumaquamarine",
colT = "dodgerblue3",
colF = "red1",
colNULL = "grey60",
lightMode = NULL,
Crange = getOption("jam.Crange"),
Lrange = getOption("jam.Lrange"),
adjustRgb = getOption("jam.adjustRgb"),
indent = "",
useCollapseList = ",\n ",
useCollapseBase = ", ",
level = 1,
debug = 0,
useColor = TRUE,
verbose = FALSE,
...
)Arguments
- argTextA
object passed by
jargs()when iteratively parsing function argument values.- name
charactername of the argument.- col1, col2, colT, colF, colNULL
charactercolors used as defaults for first and second arguments, TRUE, FALSE, NULL, respectively.- lightMode
logicalorNULL, indicating whether the text background color is light, thus imposing a maximum brightness for colors displayed. It use lightMode if defined by the function caller, otherwise it will usegetOption("jam.lightMode")if defined, lastly it will attempt to detect whether running inside Rstudio by checking the environment variable "RSTUDIO", and if so it will assume lightMode==TRUE.- Crange
numericrange of chroma values, ranging between 0 and 100. When NULL, default values will be assigned to Crange bysetCLranges().- Lrange
numericrange of luminance values, ranging between 0 and 100. When NULL, default values will be assigned to Lrange bysetCLranges().- adjustRgb
numericvalue adjustment used during the conversion of RGB colors to ANSI colors, which is inherently lossy. If not defined, it uses the default returned bysetCLranges()which itself usesgetOption("jam.adjustRgb")with default=0. In order to boost color contrast, an alternate value of -0.1 is suggested.- indent
characterstring used as a prefix in output to help apply text indent.- useCollapseList
characterstring inserted between multiple values to split list entries across multiple lines.- useCollapseBase
characterstring used to separate multiple values in a vector which is not split across multiple lines.- level
integerindicating the level of depth in iterative parsing.- debug
integervalue, greater than 0 will cause debug-type verbose output, useful because parameters are hard!- useColor
logicalwhether to display results in color, if the crayon package is available, and terminal console is capable.- verbose
logicalwhether to print verbose output.- ...
Additional arguments are ignored.
Details
This function is a rare non-exported function intended to be called by
jargs(), but separated in order to help isolate the logical
steps required.
See also
Other jam internal functions:
jamCalcDensity(),
make_html_styles(),
make_styles(),
smoothScatterJam()
Examples
cat(paste0(handleArgsText(formals(graphics::hist.default)), "\n"), sep="")
#> x
#> breaks="Sturges"
#> freq=NULL
#> probability=!freq
#> include.lowest=TRUE
#> right=TRUE
#> fuzz=1e-07
#> density=NULL
#> angle=45
#> col="lightgray"
#> border=NULL
#> main=paste("Histogram of", xname)
#> xlim=range(breaks)
#> ylim=NULL
#> xlab=xname
#> ylab
#> axes=TRUE
#> plot=TRUE
#> labels=FALSE
#> nclass=NULL
#> warn.unused=TRUE
#> ...