Allow

`NA`

s in`runningmean()`

and`runningratio()`

.Add

`scale`

argument to`time_axis()`

to allow control over time labels it gives, and`format`

argument for customized labels.Add function

`timeplot()`

, which is like`grayplot()`

but with x-axis being date/times.

Small change to documentation for

`objectsizes()`

(Mb -> MB)Added function

`time_axis()`

for helping set up axis labels for date/times.

- Include <limits.h> in a C file, for upcoming change to R.

Removed all pushbullet functions. They stopped supporting iOS which makes it useless for me.

Added warning to dec2hex() and add to documentation for that and hex2dec(), about maximum allowable values (2^31 - 1).

Revised bromanversion() to handle a case like “0.74”.

Changed default max_jiggle in dotplot() to 0.45 (rather than NULL). Similarly changed default for maxvalue in jiggle() to 0.45.

Fixed typo in help file for excel_fig().

Changed the default “jiggle” method in jiggle() and dotplot() to be “random”, as it seems to work better than the deterministic approach (“fixed”).

Fixed problem in ciplot() to avoid warnings about some graphics parameters.

grayplot() now can take mgp graphics argument.

Added argument maxvalue to jiggle(), and max_jiggle to dotplot(), to better control the horizontal jiggling of points when there is a lot of data. (Fixes Issue #8)

Make it so you can adjust the vertical lines in dotplot() by including vlines.lwd and/or vlines.col. (Fixes Issue #7)

Make it so you can use v_over_h in dotplot()

Fixed potential problem in documentation, since plot() has moved from the graphics package to base.

Added an option to include grid lines in triplot(), and a separate function trigrid() that does the work and may be called separately.

Added twocolorpal() for a color palette that goes from one color (say blue) to another (say red) through a third (say white). That is, blue to white to red.

In vec2string(), add conjunction argument, to allow a different combining word than “and”.

In ciplot(), allow argument main in … to be passed to grayplot() and so on to plot().

Added function ciplot() for plotting a set of confidence intervals.

Added operators %nin%, %win%, and %wnin%.

- a %nin% b is like !(a %in% b)
- a %win% b is like a[a %in% b]
- a %wnin% b is like a[a %nin% b]

Added function spell_out() for spelling out numbers provided they are smallish integers. Goes with the datasets numbers and Numbers.

Added function revgray() that’s like revrainbow() but white/black.

In dotplot(), make “Group” the default axis label whether rotated or not. (Was when rotate=TRUE, but not when rotate=FALSE.)

Use Markdown throughout documentation

Added function tritext(), to go with triplot(), tripoints(), trilines(), and triarrows(), but to add text annotations.

Revised openfile() so that it works on Linux.

Added function grayplot_na(). It’s like grayplot, but includes boxes near the margins to show points that are missing x or y or both.

Added function vec2string() for turning a vector into a string with the items separated by commas and an “and”. This is for use in R Markdown documents, to list a series of items.

Added function get_precision() for determining the precision of a number (the number of digits past the decimal point). I want to use this to compare two data sets with different amounts of rounding, to pick the more precise values.

Added function align_vectors() for aligning two vectors using their names attributes.

In grayplot(), have default be pch=21 and bg=“lightblue” (that is, points that are lightblue with a black circle around them).

Add bgcolor argument to triplot(), to have the background of the rectangle be gray, by default.

Also change default background in grayplot() and theme_karl() from “gray80” to “gray90” (which is much less dark of a gray).

Fix bug in dotplot() in case that y has missing values (omit them).

- In note() for RPushbullet, force ‘body’ to be non-empty, because we get an error otherwise. In done(), use body=NULL to avoid similar errors.

- Added the function crayons() which is shorthand for brocolors(“crayons”), but also can take a subset of color names, and uses grep to find partial matches. So you can use crayons(“purple mountain”) rather than brocolors(“crayons”)[“Purple Mountain’s Majesty”]

- Fix problem with pushbullet_devices(); output of RPushbullet::pbGetDevices()$devices is now a data frame; code assumes it’s a list.

- Add ‘mar’ argument to excel_fig. (plot margins; passed to par())

Add “web” colors option (from https://clrs.cc) and an alternative set of Collaborative Cross colors to brocolors()

Add checks for ^C (user interrupt) in compare_rows().

Add data numbers and Numbers (numbers 1-20 spelled out in English; numbers in lower-case and Numbers capitalized)

- Remove attachfile() and loadfile() as I don’t use them and they cause CRAN headaches.

- Add function maxabs() which just does max(abs(x)).

Add function dotplot() which is a simplified version of grayplot() for categorical x.

Add function jiggle() for horizontal jiggling, either “fixed” (deterministic, similar to the beeswarm package) or “random”; used in dotplot()

In grayplot(), have vlines and hlines follow from xlim and ylim, respectively, if they’re provided.

- Add function fac2num() for converting a factor to numeric.

Add function excel_fig() for making a figure that shows the contents of a matrix, as it might appear in Excel.

Add function pushbullet_devices() for getting list of active pushbullet devices.

Add function compare_rows(), for comparing rows in a numeric matrix, either by proportion mismatches or RMS difference.

Add function add_commas(), for adding commas in large numbers, like 91310 -> “91,310”

- Add function stop_sending_errors(), the reverse of errors2pushbullet().

- Allow use of col.lab in grayplot(), for coloring the axis titles.

- Add function switchv(), a vectorized version of switch().

- Add function openfile() for opening a file using system().

- In theme_karl(), add black rectangle around the facet rectangles, too.

- Add function theme_karl() (aka karl_theme()), with a ggplot2 theme that removes the tick boxes and adds a black border.

- Delete functions get0() and get.() since there’s going to be a get0 function in base R 3.2.0.

Add note() function, which is just a wrapper for RPushbullet::pbPost.

Revised make() to work with any directory (not just an R package). Also added a “target” argument.

- Add exit() function, which is just the same as q(“no”).

- Revise errors2pushbullet(), argument deviceind replaced by recipients.

Added argument v_over_h to grayplot(), controlling whether horizontal gridlines are on top of the vertical ones or vice versa.

Revisions to grayplot for better treatment of case of missing y. To avoid gridlines, use vlines=NA and/or hlines=NA.

- Added function attrnames() which is just names(attributes(object))

- Add function errors2pushbullet() which sets options(error) to use the RPushbullet package to send a push notification.

Add crayon colors to brocolors(), and plot_crayons function to view them. Change bg and bgpng for near-black background.

Add colwalpha function.

grayplot: change defaults for xat, yat, vlines, hlines

Added a simple utility function kbdate() for getting the date in a different format.

Added some unit tests using testthat.

- Add function make() for running make within a package directory, for use with devtools().

Add function brocolors() returning vectors of colors I use in figures.

Convert package to use roxygen2 for documentation.

- Revise tripoints() and related functions to invisibly return the (x,y) coordinates of the points, as plotted.

- Added qqline2(), which is like qqline() but for two datasets.

- Revise grayplot for better treatment of x- and y-axis titles, including the use of mgp/mgp.x/mgp.y.

- Added function histlines for making a histogram with lines().

Added function xlimlabel for determining appropriate xlim to add character string labels to a plot

Added functions strwidth2xlim and strwidth2lines for calculating margin lengths or x-axis limits that will fit a given set of text.

- In Description file, added “Depends: R (>= 2.15.0)”, since get0 uses paste0. I could use paste(…, sep=""), but…

- Changed order of plotting of vertical and horizontal lines in grayplot(). Also added ability to control the margin parameters (spacing of axis labels and such).

- Improved convert2hex so it handles numbers > 255; added alias dec2hex. Added related function hex2dec.

Added function cf() for comparing vectors/matrices/lists, including proper handling of NAs

Added functions get0() and get.() which combine get and paste.

Added grayplot() for plots with gray backgrounds.

Added manyboxplot() for making boxplot-like figures with

*many*groupsAdded paste.() function, which is just paste(…, sep=“.”)

Added function revrainbow(), which is just rev(rainbow(start=0, end=2/3, …))

Added paste00(), paste..(), paste0.() and paste.0()

runningmean() can now also calculate a running SD.

Revised bromanversion() to use packageVersion().

Simplified myround(), using sprintf().

- Added NAMESPACE (for R 2.14.0)

Revised normalize() to handle NAs.

Added function winsorize() for winsorizing a numeric vector.

Added function bromanversion() to print installed version number.

- Added function objectsizes(), for calculating the sizes of the objects in one’s workspace.

Added functions triplot(), tripoints(), trilines(), triarrow() for plotting Holmans triangle (an equilateral triangle used to depict trinomial distributions).

Added function venn() for drawing a to-scale Venn diagram.

Added function arrowlocator() for using locator() to indicate the endpoints of an arrow and then draw it.

- Fixed a bug in permtest (the pval argument didn’t work).

- Deleted the nqrank() function, as I’ve now placed it within R/qtl.

- Slight change to nqrank, so that -Inf values are replaced by 10
*less*than the minimum of any finite values (rather than 10*more*than that minimum).

- Revised runningmean and runningratio so that the statistics can be calculated at arbitrary locations. Also revised them so that the input do not need to have sorted positions.

Slight change to nqrank, to preserve the mean and SD.

Fixed a few links in the help files.

Revised h() to conform to a change in R.

- Slight change to nqrank, so that ties are not jittered by default, but may be (if one uses the argument jitter=TRUE).

- Updated license to GPL-3

Revised perm.test and paired.perm.test so that they can return the actual permutation results (rather than just the p-value), though the default is still to just return the p-value.

Fixed a bug in myround().

Revised attachfile and attachwork so that they return (invisibly) TRUE/FALSE according to whether the file was found.

Also added an argument ‘verbose’; if TRUE and the file can’t be loaded, a warning is given.

- Added a function normalize() for doing quantile normalization.

Modified fisher() so that the p-value is Prop’n >= rather than just >.

Added a similar function, chisq() for doing a chi-square test with p-value calculated by simulation. In 0.20-2, suppressed warnings produced by chisq.test.

Added a function runningratio, for calculating sum(numerator)/sum(denominator) in sliding window.

Fixed some errors in the help files.

- Fixed a bug in loadwork().

- Added a function h() for getting access to html help files while running R via ESS within emacs.

Added a function runningmean().

Fixed a bug in paired.perm.test().

- Added a function myround().

Added a function mypairs(), similar to pairs() but producing only the upper triangle.

Added a convert2hex() function.

- Added attachfile() and loadfile(), similar to loadwork() and attachwork().

- Added little utility functions loadwork() and attachwork() for loading or attaching .RData files of the form “dir
*/.RData", when*is an integer, and especially when dir =”Work".

Added perm.test and paired.perm.test for getting p-values for a two-sample t-statistic by permutation.

There was an obvious bug in the function fisher(), which is now fixed.

This is a package to contain miscellaneous R functions that I find useful.

Currently, it contains functions to get SEs of sample quantiles, a sampling version of fisher.test, a re-parse of the output of qr(), simulation from a multivariate normal distribution, and numerical integration by Simpson’s rule.