Hmisc v4.0-2


Monthly downloads



Harrell Miscellaneous

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

Current Goals

Web Sites

To Do

  • 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

Functions in Hmisc

Name Description
bpower Power and Sample Size for Two-Sample Binomial Test
aregImpute Multiple Imputation using Additive Regression, Bootstrapping, and Predictive Mean Matching Check if All Elements in Character Vector are Numeric
approxExtrap Linear Extrapolation
binconf Confidence Intervals for Binomial Probabilities
biVar Bivariate Summaries Computed Separately by a Series of Predictors
abs.error.pred Indexes of Absolute Prediction Error for Linear Models
addMarginal Add Marginal Observations
bootkm Bootstrap Kaplan-Meier Estimates
areg Additive Regression with Optimal Transformations on Both Sides using Canonical Variates
contents Metadata for a Data Frame
cnvrt.coords Convert between the 5 different coordinate sytems on a graphical device
cpower Power of Cox/log-rank Two-Sample Test
Cs Character strings from unquoted names
consolidate Element Merging
bpplot Box-percentile plots
csv.get Read Comma-Separated Text Data Files
bystats Statistics by Categories
capitalize capitalize the first letter of a string
ciapower Power of Interaction Test for Exponential Survival
dataRep Representativeness of Observations in a Data Set
data.frame.create.modify.check Tips for Creating, Modifying, and Checking Data Frames
discrete Discrete Vector tools
dotchart2 Enhanced Dot Chart
dotchartpl Enhanced Version of dotchart Function for plotly
dotchart3 Enhanced Version of dotchart Function
ffCompress Transform Data Frame Into a Compact ff Object
find.matches Find Close Matches
deff Design Effect and Intra-cluster Correlation
describe Concise Statistical Description of a Vector, Matrix, Data Frame, or Formula
event.convert Event Conversion for Time-to-Event Data
event.history Produces event.history graph for survival data
colorFacet Miscellaneous ggplot2 and grid Helper Functions
histbackback Back to Back Histograms
GiniMd Gini's Mean Difference
cut2 Cut a Numeric Variable into Intervals
curveRep Representative Curves
format.pval Format P Values
gbayes Gaussian Bayesian Posterior and Predictive Distributions
hdquantile Harrell-Davis Distribution-Free Quantile Estimator Histograms for Variables in a Data Frame
panel.bpplot Box-Percentile Panel Function for Trellis
partition Patitions an object into different sets
rcorrp.cens Rank Correlation for Paired Predictors with a Possibly Censored Response, and Integrated Discrimination Index
rcorr Matrix of Correlations and P-values
latexTherm Create LaTeX Thermometers and Colored Needles
histboxp Use plotly to Draw Stratified Spike Histogram and Box Plot Statistics
legendfunctions Legend Creation Functions
Misc Miscellaneous Functions
mtitle Margin Titles
na.detail.response Detailed Response Variable Information
rMultinom Generate Multinomial Random Variables with Varying Probabilities
rm.boot Bootstrap Repeated Measurements Model
showPsfrag Display image from psfrag LaTeX strings
src Source a File from the Current Working Directory
stat_plsmo Add a lowess smoother without counfidence bands.
equalBins Multicolumn Formating
show.pch Display Colors, Plotting Symbols, and Symbol Numeric Equivalents
errbar Plot Error Bars
first.word First Word in a String or Expression
format.df Format a Data Frame or Matrix for LaTeX or HTML
html Convert an S object to HTML
impute Generic Functions and Methods for Imputation
print.char.matrix Function to print a matrix with stacked cells
print.char.list prints a list of lists in a visually readable format.
na.keep Do-nothing na.action
rcspline.restate Re-state Restricted Cubic Spline Function
solvet solve Function with tol argument
redun Redundancy Analysis
Lag Lag a Numeric, Character, or Factor Vector
latex Convert an S object to LaTeX, and Related Utilities
mChoice Methods for Storing and Analyzing Multiple Choice Variables
mApply Apply a Function to Rows of a Matrix or Vector
num.intercepts Extract number of intercepts
nstr Creates a string of arbitry length
prnz Print and Object with its Name
escapeRegex Escapes any characters that would have special meaning in a reqular expression.
event.chart Flexible Event Chart for Time-to-Event Data
getRs Interact with github rscripts Project
getHdata Download and Install Datasets for Hmisc, rms, and Statistical Modeling
list.tree Pretty-print the Structure of a Data Object
hoeffd Matrix of Hoeffding's D Statistics
Hmisc-internal Internal Hmisc functions
prselect Selectively Print Lines of a Text Vector
reShape Reshape Matrices and Serial Data
rlegend Special Version of legend for R
simplifyDims List Simplification
subplot Embed a new plot within an existing plot Compute Summary Statistics on a Vector
makeNstr creates a string that is a repeat of a substring
Merge Merge Multiple Data Frames or Data Tables
mdb.get Read Tables in a Microsoft Access Database
%nin% Find Matching (or Non-Matching) Elements
nobsY Compute Number of Observations for Left Hand Side of Formula
somers2 Somers' Dxy Rank Correlation
plsmo Plot smoothed estimates
summaryM Summarize Mixed Data Types vs. Groups
spower Simulate Power of 2-Sample Test for Survival under Complex Conditions
summary.formula Summarize Data for Making Tables and Plots
spss.get Enhanced Importing of SPSS Files
summarize Summarize Scalars or Matrices by Cross-Classification
summaryRc Graphical Summarization of Continuous Variables Against a Response
summaryP Multi-way Summary of Proportions
upFirst Change First Letters to Upper Case
ynbind Combine Variables in a Matrix
valueTags Store Discriptive Information About an Object
Ecdf Empirical Cumulative Distribution Plot
mhgr Miscellaneous Functions for Epidemiology
ggfreqScatter Frequency Scatterplot
getZip Open a Zip File From a URL.
inc-dec Increment and Decrement
knitrSet knitr Setup and plotly Service Function
summaryS Summarize Multiple Response Variables and Make Multipanel Scatter or Dot Plot
labcurve Label Curves, Make Keys, and Interactively Draw Points and Curves
translate Translate Vector or Matrix of Text Strings
symbol.freq Graphic Representation of a Frequency Table
trunc.POSIXt return the floor, ceiling, or rounded value of date or time to specified unit.
xtfrm.labelled Auxiliary Function Method for Sorting and Ranking
latexDotchart Enhanced Dot Chart for LaTeX Picture Environment with epic Mean x vs. function of y in groups of x
latexTabular Convert a Data Frame or Matrix to a LaTeX Tabular
multLines Plot Multiple Lines
na.delete Row-wise Deletion na.action
pc1 First Principal Component
rcspline.eval Restricted Cubic Spline Design Matrix
plotCorrPrecision Plot Precision of Estimate of Pearson Correlation Coefficient
stata.get Enhanced Importing of STATA Files
popower Power and Sample Size for Ordinal Response Determine Dimensions of Strings
sys Run Unix or Dos Depending on System
t.test.cluster t-test for Clustered Data
varclus Variable Clustering
label Label Attribute of an Object
mgp.axis Draw Axes With Side-Specific mgp Parameters
pstamp Date/Time/Directory Stamp the Current Plot
minor.tick Minor Tick Marks
rcorr.cens Rank Correlation for Censored Data
samplesize.bin Sample Size for 2-sample Binomial
sasxport.get Enhanced Importing of SAS Transport Files using read.xport
wtd.stats Weighted Statistical Estimates
rcspline.plot Plot Restricted Cubic Spline Function
score.binary Score a Series of Binary Variables
sedit Character String Editing and Miscellaneous Character Handling Functions
transace Additive Regression and Transformations using ace or avas
xYplot xyplot and dotplot with Matrix Variables to Plot Error Bars and Bands
transcan Transformations/Imputations using Canonical Variates
yearDays Get Number of Days in Year or Month
Save Faciliate Use of save and load to Remote Directories
scat1d One-Dimensional Scatter Diagram, Spike Histogram, or Density
string.break.line Break a String into Many Lines at Newlines
stringDims String Dimentions
tabulr Interface to Tabular Function
tex function for use in graphs that are used with the psfrag package in LaTeX
units Units Attribute of a Vector
upData Update a Data Frame or Cleanup a Data Frame after Importing
No Results!

Last month downloads


Include our badge in your README