The jamba package contains several jam base functions which are re-usable for routine R analysis work, and are important dependencies for other Jam R packages.
Details
See the function reference for a complete list of functions.
The goal is to implement methods as lightweight as possible, so so inclusion in an analysis workflow will not incur a noticeable burden.
plot functions
plotSmoothScatter()enhanced variant ofsmoothScatter()to show more visual detailimageDefault()enhanced rasterizedimage()with fixed aspect ratioimageByColors()fordata.frameof colors and optional labels centered across repeated values.showColors()color display for vector, list, color function, or mixed formats.nullPlot()blank plot that labels the current margin sizesminorLogTicksAxis()log-scale axis ticks in base R with custom log base, optional offset, e.g.log2(1 + x)shadowText()base R text labels with shadow or outline or both, alsoshadowText_options().getPlotAspect(),decideMfrow()convenience base R graphics.
string functions
mixedSort(),mixedOrder(),mixedSortDF()- efficient alphanumeric "version" sort, with options helpful for gene symbols.vgrep(),vigrep(),igrep(),vigrep()fast grep wrappers for value-return, case-insensitive search.provigrep(),proigrep()- progressive, ordered grep to use pattern matching to re-order a vector.makeNames()create unique, versioned names with custom formatnameVector()apply names to vector dynamicallynameVectorN()vector of named names useful withlapply().pasteByRow(),pasteByRowOrdered()paste data.frame and matrix values by row, skipping blanks, optional factor order.rbindList()convert list tomatrixordata.frame.tcount()extendstable()to sort by size and optional minimum count filter.
color functions
rgb2col(),col2hcl(),col2hcl(),col2hsv(),hsv2col()color interconversionsetTextContrastColor()text contrast color per given background colorgetColorRamp()catch-all to get named gradients, or expand one or more colors to gradient.makeColorDarker(),color2gradient()create light/dark altered variants of colors.showColors()versatile display of color ascharactervector orlistofcharacterorfunction.
miscellaneous helper functions
printDebug()colored text output to console, 'Rmarkdown', HTMLkable_coloring()coloredkableExtra::kable()output for 'Rmarkdown'setPrompt()colored R promptgetDate(),asDate(),dateToDaysOld()human-readable, opinionated date formattingpadString(),padInteger()pad character or integer stringsrmNA(),rmNULL(),rmInfinite()remove or replace missing or NA values with defined alternatives
export and import functions
readOpenxlsx()import worksheets from 'xlsx' 'Excel' files.writeOpenxlsx()export worksheets to 'xlsx' 'Excel' files with color, formatting, and styling.reload_rmarkdown_cache()load Rmarkdown cache data into anenvironmentfor re-use.reload_qmd_cache()load Quarto .qmd cache data into anenvironmentfor re-use.
Jam options
The jamba package recognizes some global options, but limits these
options to include only non-analysis options. For example, no global
option should change the numerical manipulation of data.
jam.lightMode-logicalwhether the R console or graphical background is light or dark,printDebug()limits the luminance range to maximize visual contrast.jam.Crange,jam.Lrange- numerical values used byprintDebug()to maximize visual contrast, used withjam.lightMode.jam.shadowColor,jam.shadow.r,jam.shadow.n,jam.alphaShadow,jam.outline,jam.alphaOutlineto customize details forshadowText(), seeshadowText_options()for convenience.
Author
Maintainer: James M. Ward jmw86069@gmail.com (ORCID) [copyright holder]
Authors:
James M. Ward jmw86069@gmail.com (ORCID) [copyright holder]