Learn R Programming

R/broman

R/broman is an R package with miscellaneous R functions that are useful to me. It includes many functions related to graphics (mostly for base graphics), permutation tests, running mean/median/sum/ratio, and a variety of utilities for programming, for data diagnostics/cleaning, and for writing reproducible data analysis reports.


Installation

Install the R/broman package from CRAN:

install.packages("broman")

Alternatively, install it from R universe:

install.packages("broman", repos=c("https://kbroman.r-universe.dev",
                                    "https://cloud.r-project.org"))

Or use remotes to install it from its GitHub source:

install.packages("remotes")
remotes::install_github("kbroman/broman")

Vignette

A vignette describing the use of the package is available on the web.


License

This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.

A copy of the GNU General Public License, version 3, is available at https://www.r-project.org/Licenses/GPL-3

Copy Link

Version

Install

install.packages('broman')

Monthly Downloads

2,619

Version

0.98

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Karl Broman

Last Published

July 20th, 2026

Functions in broman (0.98)

ciplot

Effect plot with multiple CIs for different groups
align_vectors

Align two vectors
add_commas

Add commas to a large number
arrowlocator

Use the locator function to plot an arrow
colwalpha

Convert a color to use alpha transparency
excel_fig

Excel-style figure displaying contents of a matrix
convert2hex

Convert decimal to hex
get_precision

Determine the precision of a number
compare_rows

Compare rows in a matrix
fac2num

Convert a factor to numeric
fisher

Fisher's exact test for a two-way table
exit

exit R without saving
dotplot

Dot chart with a gray background
crayons

Crayon colors
jiggle

Jiggle points horizontally
hex2dec

Convert from hex to decimal
h

View html version of help file
grayplot

Scatterplot with a gray background
lenuniq

Number of unique values
histlines

Utility to create line-based histogram
grayplot_na

Scatterplot with missing values indicated
manyboxplot

Boxplot-like figure for many groups
kbdate

My little date facility
make

Run make within a package directory
maxabs

maximum of absolute value
numbers

Numbers spelled out in English
%nin%

Value matching
objectsizes

Calculate sizes of all objects in workspace
myround

Round a number, preserving extra 0's
paired.perm.test

Paired permutation t-test
normalize

Quantile normalization
mypairs

My scatterplot matrix
paste.

paste with dot separator
openfile

Open a file
plot_crayons

Illustration of crayon colors
revgray

Create vector of colors from white to black
qqline2

qqline for qqplot
perm.test

Permutation t-test
pick_more_precise

Pick the more precise value for each element in two related vectors
quantileSE

Sample quantiles and their standard errors
qr2

The QR decomposition of a matrix
rmvn

Simulate multivariate normal
revrainbow

Create vector of colors from blue to red
paste00

paste with null or dot as separator and with collapse
runningmean

Running mean, sum, or median
switchv

Vectorized version of switch
spell_out

Spell out an integer
strwidth2lines

Calculate width of a character string in number of lines
strwidth2xlim

Calculate horizontal limit in user coordinates for adding labels
theme_karl

Karl's ggplot2 theme
runningratio2

Running ratio with adaptive window
setRNGparallel

Set up random number generation for parallel calculations
simp

Numerical integration
runningratio

Running ratio
triarrow

Plot an arrow within a ternary plot
timeplot

Scatterplot with date/times on the x-axis
time_axis

Set up a time-based axis
trigrid

Add grid lines to triplot
tripoints

Plot points within a ternary plot
triplot

Plot ternary diagram (triangle plot)
vec2string

Turn a vector into a single character string
twocolorpal

Create vector of colors from blue to white to red
tritext

Plot text within a ternary plot
trilines

Plot lines within a ternary plot
xlimlabel

Calulate horizontal limit in user coordinates for adding labels
venn

Plot to-scale Venn diagram
winsorize

Winsorize a vector
attrnames

Get names of attributes
cf

Compare objects, including missing data pattern
bromanversion

Installed version of R/broman
brocolors

Vectors of colors for figures
chisq

Chi-square test by simulation for a two-way table
broman-package

broman: Karl Broman's R Code