Learn R Programming

broman (version 0.86)

Karl Broman's R Code

Description

Miscellaneous R functions, including functions related to graphics (mostly for base graphics), permutation tests, running mean/median, and general utilities.

Copy Link

Version

Install

install.packages('broman')

Monthly Downloads

2,239

Version

0.86

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Karl Broman

Last Published

June 8th, 2025

Functions in broman (0.86)

hex2dec

Convert from hex to decimal
grayplot_na

Scatterplot with missing values indicated
maxabs

maximum of absolute value
kbdate

My little date facility
jiggle

Jiggle points horizontally
manyboxplot

Boxplot-like figure for many groups
histlines

Utility to create line-based histogram
%nin%

Value matching
objectsizes

Calculate sizes of all objects in workspace
numbers

Numbers spelled out in English
pick_more_precise

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

Calculate width of a character string in number of lines
spell_out

Spell out an integer
normalize

Quantile normalization
runningmean

Running mean, sum, or median
h

View html version of help file
perm.test

Permutation t-test
revrainbow

Create vector of colors from blue to red
mypairs

My scatterplot matrix
quantileSE

Sample quantiles and their standard errors
revgray

Create vector of colors from white to black
myround

Round a number, preserving extra 0's
rmvn

Simulate multivariate normal
qr2

The QR decomposition of a matrix
grayplot

Scatterplot with a gray background
paste.

paste with dot separator
runningratio

Running ratio
xlimlabel

Calulate horizontal limit in user coordinates for adding labels
runningratio2

Running ratio with adaptive window
tripoints

Plot points within a Holmans triangle
winsorize

Winsorize a vector
triplot

Plot Holmans triangle
lenuniq

Number of unique values
plot_crayons

Illustration of crayon colors
trigrid

Add grid lines to triplot
setRNGparallel

Set up random number generation for parallel calculations
simp

Numerical integration
openfile

Open a file
paste00

paste with null or dot as separator and with collapse
qqline2

qqline for qqplot
vec2string

Turn a vector into a single character string
venn

Plot to-scale Venn diagram
tritext

Plot text within a Holmans triangle
paired.perm.test

Paired permutation t-test
make

Run make within a package directory
twocolorpal

Create vector of colors from blue to white to red
trilines

Plot lines within a Holmans triangle
theme_karl

Karl's ggplot2 theme
time_axis

Set up a time-based axis
strwidth2xlim

Calculate horizontal limit in user coordinates for adding labels
switchv

Vectorized version of switch
timeplot

Scatterplot with date/times on the x-axis
triarrow

Plot an arrow within a Holmans triangle
align_vectors

Align two vectors
arrowlocator

Use the locator function to plot an arrow
add_commas

Add commas to a large number
get_precision

Determine the precision of a number
fac2num

Convert a factor to numeric
compare_rows

Compare rows in a matrix
chisq

Chi-square test by simulation for a two-way table
ciplot

Effect plot with multiple CIs for different groups
cf

Compare objects, including missing data pattern
brocolors

Vectors of colors for figures
colwalpha

Convert a color to use alpha transparency
exit

exit R without saving
convert2hex

Convert decimal to hex
attrnames

Get names of attributes
dotplot

Dot chart with a gray background
bromanversion

Installed version of R/broman
fisher

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

Excel-style figure displaying contents of a matrix
crayons

Crayon colors