Contains many functions useful for data analysis, high-level graphics, utility operations, functions for computing sample size and power, importing and annotating datasets, imputing missing values, advanced table making, variable clustering, character string manipulation, conversion of R objects to LaTeX and html code, and recoding variables.

Harrell Miscellaneous

- Continue to refine the summaryX class of functions that replace tables with graphics
- See also bpplotM and tabulr

- See http://biostat.mc.vanderbilt.edu/HmiscNew

- Overall: http://biostat.mc.vanderbilt.edu/Hmisc
- CRAN: http://cran.r-project.org/web/packages/Hmisc
- Changelog: https://github.com/harrelfe/Hmisc/commits/master

- Consider using the haven package for importing SAS, Stata, and SPSS files; haven stores labels as the label attribute of each variable as does Hmisc; it converts date and time variables automatically and allows one to specify a format catalog along with the primary dataset
- See if the readstata13 package has advantages over the foreign package for Stata file import
- Consider creating xl.get using the readxl package to read .xls and .xlsx Excel files
- In impute.transcan, sense if a variable in data is not a factor whereas it was treated as a factor during aregImpute; it should be converted to factor before the line v[sub] <- ... levels(as.integer...)) is run

Changes in version 4.0-1 (2016-12-04)

- gbayes: new test file, fixed bug in posterior mean when mix=0,1 in gbayesMixPost
- ggfreqScatter: added prfreq and cuts arguments
- latex.summary.formula.reverse, latex.summaryM, html.summaryM: fixed bug with backslash added before % for html, improved typesetting language logic
- latex.describe: fixed bug that prevented spike histogram from appearing
- ggplot.summaryP: moved text out of aes in geom_point, left in main aes
- plot.describe, plot.summaryP: put text aes in ggplot(), increased ggplotly height to allow popups for top continuous variables in plot.describe
- dotchartp, dotchartpl, plot.describe: moved height and width from plotly::layout to plot_ly because of changes in plotly 4.5.6
- bppltp: added data= to plot::add_* because plotly was evaluating using the wrong copy of x,y, etc.
- plot.summary.formula.reverse, plot.summaryM: removed subtitles argument since not used
- upData: fixed bug when converting existing variable to factor; was not recognizing new storage model and tried to run floor()
- latex.summary.formula.reverse: fixed bug where outer quantiles and frequencies were not being rendered
- latex.default: put \par in front of insert.bottom if table.env is FALSE, so that text is not put to the side of the table
- histboxp: new function for plotly stratified spike histograms with box plot statistics also depicted
- format.df, latex.default: added arguments already.math.row.names, already.math.col.names that if TRUE prevent any math mode changes
- latex.default: fixed problem with duplication of columns in the cellT...exCmds array (thanks: Thomas Dupont)
- tests/summaryM-customtest: new test (see https://github.com/harrelfe/Hmisc/issues/61)
- describe: improved logic for deciding when and how to show frequency table, changed condense argument
- htmlVerbatim: added propts and omit1b arguments
- latexNeedle, pngNeedle: added x argument
- latex.describe: allowed for unequally-spaced x in spike histograms
- html.describe: added spike histograms
- base64: new IMPORTS in DESCRIPTION
- sedit, latexTranslate: changed 1 : length(text) to seq_along(text). Thanks: Greg Snow
- ggfreqScatter: better formatting of axis tick mark labels
- latexVerbatim: implemented file=''

Changes in version 4.0-0 (2016-10-31)

- summaryP: fixed exclude1 logic - was not excluding enough levels (inconsistent use of variable names vs. labels)
- latexTranslate: any NAs in first argument changed to "" before conversion
- minor.tick: added arguments to pass through (thanks: vhorvath)
- tests/latexpng.r: test conversion of LaTeX table to png
- latexTabular: made it properly call latexTranslate separately for each column, convert argument to matrix or data frame if a vector
- tests/latexTabular.r: new test
- latexDotchart: added call to latexTranslate to escape special characters for LaTeX such as underscore and pound sign
- ggfreqScatter: new function
- grType: new non-exported service function to sense if plotly is in effect
- plot.describe: new function to make plotly graph for describe objects
- describe: changed output: 3 decimal places for Info, new format for frequency table, separated logic for 10 extreme values from logic for frequency table, significant changes to print.describe
- dotchartp: new version of dotchart3 for plotly charts
- summaryD: modified to use dotchartp if options(grType='plotly') is in effect
- nFm: added argument html
- label.default, label.Surv, labelPlotmath: added html argument to implement HTML markup in place of plotmath (for plotly)
- now imports htmlTable, viridis
- html.contents.data.frame: return invisibly if file=''
- htmlVerbatim: new function
- html.contents.data.frame: improved html
- html.data.frame: changed column headers from h4 to
- ggfreqScatter: added html argument
- knitrSet: was ignoring default figure h and w
- html.summaryM: new function using new version of latex.summaryM
- markupSpecs: new list object defining markup elements for latex and html, used by summaryM
- show.html, print.html: removed; conflicted with htmltools/rmarkdown
- label: required exact match on attribute name "label" to not retrieve the "labels" attribute (thanks: Ivan Puzek)
- htmlSN: new function to convert floating point to scientific format usint html
- upData, cleanup.import: fix NA becoming new factor levels (thanks: Beau Bruce)
- htmlTranslate: new function
- plotlySave: new function
- histSpikep: new function
- upData: new argument html
- plot.describe: added ggplot2 graphics, improved continuous display using ggplotly
- labelPlotmath: cleaned up by using markupSpecs
- capitalize: fixed bug - did not cap. first letter if other letters after it were upper case (thanks: dchiu911)
- html.summaryM: added brmsd argument to put mean, SD on separate line
- Save: changed default back to use gzip for speed
- knitrSet: used new knitr way to set aliases for option names
- latexTabular: made translate argument apply to body of table also; implemented multi-line header
- html.data.frame: added several arguments
- describe: added html method
- html markupSpecs object: added bibliographic database utility functions
- bppltp: new service function for extended box plots for plotly
- plot.summaryM: new plotly method
- prType: new service function used to detect user settings for html, latex for print methods
- html.contents.data.frame: removed file and append arguments and output an html character vector instead
- prList: new function
- GiniMd: moved to Hmisc from rms
- describe: added GMD (Gini's mean difference) and relabeled unique to distinct
- latex.summaryM: added Needspace{2.7in} before 2nd and later strata
- ggplot.summaryP: added point labels for use with plotly as hover text
- latex.summaryP: fixed bad linebreak at strata boundaries
- dotchartpl: new plotly dot chart function especially for summaryP
- plot.summaryP: new plotly method using dotchartpl when options(grType='plotly')
- putHfig: new function to render graphics with captions in HTML reports
- pngNeedle: new function, like latexNeedle but useful with HTML reports
- html.data.frame: added width and caption arguments
- plotlyParm: list object with plotly helper functions
- summaryD, dotchartp: added symbol and col arguments
- upData: improved efficiency, added labelled class to variables without it but having labels (e.g., data imported using haven package)
- gbayesMixPost: mixed error in posterior odds of the mixing parameter that resulted in incorrect posterior probabilities when the variance of the statistic was appreciable; added option to compute posterior mean

Changes in version 3.17-4 (2016-05-02)

- latex.summaryP: correctly ordered rows after running reshape because groups was present
- rcspline.plot: took confidence limits into account when computing default ylim
- bootkm: new test in tests
- [.ynbind: Made it return an unclassed vector if the user was subsetting to a single column. Upcoming R release fails in table() otherwise. Thanks: Michael Lawrence lawrence.michael@gene.com
- Merge: added function (moving from greport package)
- data.table: imports

Changes in version 3.17-3 (2016-04-03)

- latex.default: added blank lines after textbf with insert.top unless center='center' (was unless 'none')
- plot.summaryS: fixed bug were limits were not aligned with columns (thanks: Liping Du)
- mgp.axis: respected par('tcl') but only as extreme as -0.4
- mgp.axis: added cex.axis, cex.lab arguments
- aregImpute: added reformM function for permuting order of variables. Thanks: Yong Hao Pua
- latex: fixed rownamesTexCmd error

Changes in version 3.17-2 (2016-02-13)

- consolidate: A simpler version of assignment form of consolidate, avoids eval/match.call and works with the byte-compiler (thanks: Tomas Kalibera)
- relevel.labelled: new function (thanks: Max Gordon)
- fit.mult.impute: remove contrasts attribute for imputations done by mice
- formatCons: fixed bug when stats contains one row (thanks: Cole Beck)
- Hmisc.h: removed reference to S.h
- fit.mult.impute.s: moved source code to separate file, away from transcan.s
- fit.mult.impute: added warning if fitter is lm, which does not use imputation variances for sigma or standard errors
- spss.get: added reencode argument (Thanks: Andreas Osowski)

Changes in version 3.17-1 (2015-12-17)

- sasxport.get: added lowernames argument with default equal to the previous behavior (convert varixcable names to lower case)
- biVar, rcorrp.cens, spower, transace: changed 1 - pnorm(z) to pnorm(-z)

- latex.summaryM: added arguments prob, prN, and legend.bottom
- print.summaryM: added arguments prob and prN
- Save: changed to use compress='xz' by default, and added compress argument
- drawPlot: fixed bug in defining Points and Curve functions; added col argument to Points and Curve; removed helper functions for Points and Curve from Key.s; returned object invisibly; added type='loess' to Curve()
- upFirst: new function
- mdb.get: added mdbexportArgs argument which among other things allows -b strip to be omitted
- html: for hevea added definition of tabularnewline as \, changed method to default to hevea
- summaryM: fixed calculation of N for mChoice variables
- stat-plsmo.r: re-written by Hadley Wickham (thanks!) to work with new ggplot2
- ggplot.summaryP, ggplot.transcan: added mapping and environment arguments to satisfy rules about generics

Changes in version 3.17-0 (2015-09-20)

- format.df (used by latex.default): added space after textless, textgreater
- label: changed default for units to value of plot
- getRs: replaced where argument with guser, grepo, gdir, dir to allow easy fetching of updated functions from Hmisc etc.
- Separated sas.get source code from other .get functions and from upData/cleanup.import by putting into 3 separate files. Moved stata.get into misc.get.s
- upData: for Stat/Transfer exported R workspaces, change variables into factors to incorporate value labels when present; added subset argument and reporting of number of observations pre and post subsetting
- latex.default: added comma after botcap directive for ctable. Thanks: Paul Trowbridge

- Hmisc-internal.Rd: removed alias{[.terms}
- latex.default: for longtable when no caption is given, subtract one from table counter
- latex.summaryM: quit ignoring insert.bottom if it is a character string (thanks: JoAnn Alvarez)
- minor.tick: revised version by Earl Belllinger that fixes problem reported in https://github.com/harrelfe/Hmisc/issues/28
- several functions: used new names when assigning temporary functions
- NAMESPACE: add imports to base functions to avoid new R CMD CHECK warnings
- ffCompress: new function
- knitrSet: changed fig.path default to '' instead of NULL to work with knitr 1.11
- html.latex: added argument rmarkdown
- htmltools: added to suggests in DESCRIPTION
- tests: new test script latex-html.Rmd for latex -> html under Rmarkdown/knitr/Rstudio, new test for cut2
- plsmo, panel.plsmo: added method='intervals', mobs, ifun arguments

Changes in version 3.16-0 (2015-04-25)

- html.contents.data.frame: corrected html space character to add semicolon
- ggplot.summaryP: added size of points according to denominators
- colorFacet: new function
- labelPlotmath: added chexpr argument (used by rms::ggplot.Predict)
- rcsplineFunction: added type='integral'
- summaryP: fixed bug with sort=FALSE using mfreq when shouldn't
- summaryP: stored levels(val) in original levels order
- summaryM: removed observations added by addMarginal when computing N in left column of tables
- html.latex: added method for htlatex, added where argument, cleaned up code, implemented file='' for knitr when using html/Rmarkdown
- summaryM, summary.formula: changed calls to translate to gsub()
- summaryP: corrected but in exclude1 logic, moved exclude1 to methods that operate on summaryP objects and out of summaryP itself
- addMarginal: respect original levels, add argument margloc
- added latticeExtra:: in front of function calls
- numeric.string, all.is.numeric: replaced options(warn=-1) with suppressWarnings() (thanks: Yihui)
- arrGrob, print.arrGrob: new functions
- wtd.var: added maximum likelihood method, fixed unbiased method, improved documentation (all provided by Benjamin Tyner)
- Changed all any(duplicated()) to anyDuplicated(); thanks Benjamin Tyler
- getRs: new function to interact with https://github.com/harrelfe/rscripts
- knitrSet: new function to setup knitr with nice defaults for books etc.
- rcorr: fixed sensing of NAs and diagonal elements of n matrix; thanks: Keith Jewell, Campden BRI Group; similar for hoeffd

Changes in version 3.15-0 (2015-02-15)

- dvi.latex: For Windows switched from system() to shell() so that cd command works. Thanks: Rich Heiberger
- histSpike: added test
- histSpikeg: new function for ggplot2
- added ggplot2 in DESCRIPTION, NAMESPACE
- largest.empty: clarified help file for use with ggplot2, changed how sensed xlim and ylim accordingly
- stat_plsmo: new geom for ggplot2
- transcan: added ggplot method
- transace: removed y-axis labels
- residuals.lrm: remove y-axis labels
- histSpikeg: added lowess and span arguments
- format.df: Andreas Kiermeier: The "..." argument of format.df is no longer ignored, but included in the definition of formt() and passed to format(). The help file has also been updated and the example modified to show an example of big.mark.
- getHdata: removed S-Plus specific stuff, updated url to DataSets
- summaryP: added ggplot method
- NAMESPACE: many additions to register all S3 methods
- format.sep: renamed to formatSep

Changes in version 3.14-6 (2014-11-16)

- wtd.rank: fixed bug in no weights case (thanks: DPlat)
- latex.summaryM, latex.summary.formula.reverse: added npct='slash' to present numerators and denominators horizontally instead of vertically
- plsmo: put derivation of ylab earlier so will use original attributes
- NAMESPACE: exported more S3 methods for label
- contents: added arguments id, range, values
- print.contents.data.frame, html.contents.data.frame: added maxlevels argument
- curveRep: added option to have the color of frequencies displayed match line colors. Thanks: jstat10
- curveRep: changed call to strwidth to use units instead of unit argument
- contents.data.frame: corrected omission in help file
- wtd.var: corrected denominator. Thanks: Shan Huang
- latex.default: changed to use colheads=FALSE to suppress column headings. Thanks: Michael Rose
- mdb.get: added system option -b strip to mdb-export to skip binary output
- describe help file: added note that correct terminology for "unique" should have been "distinct"

Changes in version 3.14-5 (2014-09-11)

- latex.summaryM: fixed bug in caption with test=TRUE. Thanks: Yonghao Pua
- csv.get: uses data.table package's fread in place of read.csv if data.table is in effect
- combined.levels: sensed all NA vector, now return non-factor numeric instead
- dataframeReduce: handle all-NA factor variable
- subplot: replaced with latest version from TeachingDemos package by Greg Snow
- latexTabular: fixed error in example in help file; result is not a file
- latex: another test added in tests/latex.s
- summaryP: removed observations with a right-hand-side variable missing
- latex.summaryP: fixed bug with wrong column labels due to reshape reordering columns coming from factor levels alphabetically instead of by original levels
- format.df: added % & <= >= to list of characters handled, the last two by going into math mode
- latex.summaryP: use blank if denominator 0, instead of NaN
- summary.formula: fixed problem with deparse formula. Thanks: Andreas Kiermeier
- describe: added relative information measure for numeric variables - a measure of how continuous the variable is
- wtd.table: detect duplications using duplicated() instead of diff(x) to handle Inf. Thanks: Benjamin Tyner
- DESCRIPTION, NAMESPACE: multiple function changes to work in R-devel

Changes in version 3.14-4 (2014-04-13)

- rcspline.eval: stop new logic for ignoring outer values when there are many ties when there are also many ties on interior values. Added new logic to use interior unique values of x when the number of unique x is small.
- latexBuild: generalized with insert argument
- latex.default: modified to use mods of latexBuild, fixed bug with caption.loc='bottom' (thanks: YacineH)
- latex.default: fixed bug where comma did not appear after caption={} for ctable (thanks: Johannes Hofrichter)
- tests: fit.mult.impute.bootstrap.r: added new example (thanks: Jane Cook)
- fit.mult.impute: added call for fit.mult.impute in returned object, replacing call from fitter; makes update work for fit.mult.impute
- summary.formula: fixed recognition of multiple left-hand-side variables to trigger call to summaryM (thanks: Kevin Thorpe)
- summaryM: changed group label to '' instead of 0 for formulas like age + sex ~ 1
- Ecdf: added what argument to all functions
- nobsY: return constructed id vector
- addMarginal: instead of .marginal. being logical, make it contain names of variables being marginalized over
- mChoice.c: fixed some inconsistencies

Changes in version 3.14-3 (2014-03-02)

- format.df: clarified in help file that col.just can contain specifications other than l,r,c, e.g., "p{3in}" to get paragraph formatting in a column. Thanks: Ben Bolker
- latex.default: added example for the above in tests
- label.Surv: got units from inputAttributes in addition, and added type argument

Changes in version 3.14-2 (2014-02-26)

- latex.default: improved logic using new function in Misc: latexBuild
- latex.default: fixed bug with ctable=TRUE with no caption by removing default label

- latex.default: improved formatting for insert.top
- latex.default: added tests, fixed insert.bottom
- latex.summaryM: return stat summary key as legend attribute, use this according to insert.bottom argument
- latex.summary.formula.response: fixed bug related to computation of cdec. Thanks: Kevin Thorpe
- latex.default: added new argument star: ctables uses this to spread over two columns when the LaTeX document is in \twocolumn mode. Thanks: David Whiting

Changes in version 3.14-1 (2014-02-25)

- Added latexNeedle function
- Change latexTherm, latexNeedle to use user LaTeX macro \tooltipn to do the pop-up
- latex.default: changed line breaks around \end{tabular}
- latex.summaryM: put insert.bottom text in minipage so \tooltip will not devote wide space to it
- sas.get: added defaultencoding argument and logic (Thanks: Reinhold Koch)
- plot.summaryP: omit tick marks for proportion > 1.0
- format.df (used by latex): fixed na.blank logic for character var
- latex: removed newlines when ending environments, added hyperref argument
- latex: added center='centerline', fixed 'centering'
- upData, cleanup.import, dataframeReduce: changed argument pr to print
- rcspline.eval: added more evasive action in case of extreme ties

Changes in version 3.14-0 (2014-01-22)

- Added trans argument to varclus
- Removed recode, existsFunction functions, under.unix object, survfitKM, functions used only by S-Plus: comment, mem, mulbar.chart, p.sunflowers
- as.category, is.category, untangle.special: removed
- Removed reference to .R. from many functions
- Remove oldClass, oldUnclass, getFunction
- latex.default: changed 'rotate' to 'sideways' for ctable mode. Thanks: Simon Zehnder szehnder@uni-bonn.de
- gView: removed
- ldBands: removed
- summaryP: new function - graphical replacement for tables of proportions
- ynbind: new function for combining related yes/no variables into a matrix with a label
- added file argument to prn
- summaryP: added autoarrange
- added addMarginal and nobsY functions
- pBlock: new function for blocking variables for summaryP
- summaryP: changed text positioning to grid absolutes, added text.at argument
- scat1d, histSpike: if grid used and y has grid units, fixed logic for frac
- plsmo, panel.plsmo: added scat1d.opts argument
- label.Surv, units.Surv: added, removed ::: in survival calls
- summarize: added keepcolnames argument
- Suppressed startup message unless options(Hverbose=TRUE) is set
- summaryS: new function - multi-panel lattice xy and dot plots
- summaryD: added ylab argument
- dotchart3: quit letting left margin be less than pre-existing one
- multLines: new function
- Improved nobsY to respect subject IDs when counting number of subjects, and to return an attribute 'formula' without id variable; changed bpplotM, summaryP, summaryS to use this
- Removed nobsY calculations from bpplotM, summaryP, summaryS, enhanced nobsY to allow stratification by treatment
- panel.bpplot: added violin and violin.opts arguments
- summaryS: added medvPanel support during-plot vertical violin plots
- plot.summaryP: padded x-axis limits
- latexTabular: added translate and hline arguments; moved to its own file and help page
- latexTherm: added tooltip using LaTeX ocgtools package
- summaryP: stopped reversing order of panels
- summaryM: added table.env argument, changed how model.frame built
- latex.summaryM: changed to print proportions by default, added round='auto'
- character.table: added xpd=NA; thanks: Dale
- summaryP: added latex method
- latex.default: added insert.top argument
- summaryM: added stratification (multiple tables)

Changes in version 3.13-0 (2013-11-18)

- Changed n location (nloc argument) in bpplotM
- Improved dotchart3 to better compute string widths when there is a mixture of expressions and regular strings for auxdata/auxtitle
- Changed rlegend to not take logs if log axes are in effect. Fixes Ecdf(..., log='x', label.curves=list(keys=1:3)). Thanks: Bayazid Sarker sarkarbayazid@gmail.com
- Extended non-panel (regular) version of plsmo to handle matrix y

- Likewise for summaryRc
- Added xlim to bpplotM
- Added latexTherm function to create LaTeX picture environments to add a series of thermometers to LaTeX text
- Fixed deff to handle the case where R^2 = 1. Thanks: Matthieu Stigler matthieu.stigler@gmail.com
- Added new test file for wtd.mean, wtd.quantile
- New test aregImpute3.r for glm Poisson regression
- Improved describe.vector to format single unique values
- Took away warning about var, s.e., t, p in fit.mult.impute
- Switched from subversion to github repository
- Changed maintainer from Charles Dupont to Frank Harrell
- Changed wtd.loess.noiter to use loess instead of stats:::simpleLoess