Learn R Programming

⚠️There's a newer version (0.99.60) of this package.Take me there.

DescTools

Tools for Descriptive Statistics and Exploratory Data Analysis

Copy Link

Version

Install

install.packages('DescTools')

Monthly Downloads

104,795

Version

0.99.34

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Andri Signorell

Last Published

March 12th, 2020

Functions in DescTools (0.99.34)

Abind

Combine Multidimensional Arrays
BarText

Add the Value Labels to a Barplot
AxisBreak

Place a Break Mark on an Axis
Assocs

Association Measures
BootCI

Simple Bootstrap Confidence Intervals
Arrow

Insert an Arrow Into a Plot
AscToChar

Convert ASCII Codes to Characters and Vice Versa
Atkinson

Atkinson Index - A Measure of Inequality.
BinomRatioCI

Confidence Intervals for the Ratio of Binomial and Multinomial Proportions
BarnardTest

Barnard's Unconditional Test
Benford

Benford's Distribution
BrierScore

Brier Score for Assessing Prediction Accuracy
BoxCox

Box Cox Transformation
Between, Outside

Operators To Check, If a Value Lies Within Or Outside a Given Range
BinomDiffCI

Confidence Interval for a Difference of Binomials
BoxCoxLambda

Automatic Selection of Box Cox Transformation Parameter
BinTree

Binary Tree
BartelsRankTest

Bartels Rank Test of Randomness
Base Conversions

Converts Numbers From Binmode, Octmode or Hexmode to Decimal and Vice Versa
CentralValue

Obtain statistic of centrality
CochranQTest

Cochran's Q test
BreslowDayTest

Breslow-Day Test for Homogeneity of the Odds Ratios
BinomCI

Confidence Intervals for Binomial Proportions
Asp

Get Aspect Ratio of the Current Plot
Clockwise

Calculates Begin and End Angle From a List of Given Angles in Clockwise Mode
CartToPol

Transform Cartesian to Polar/Spherical Coordinates and Vice Versa
BreuschGodfreyTest

Breusch-Godfrey Test
CochranArmitageTest

Cochran-Armitage Test for Trend
BoxedText

Add Text in a Box to a Plot
ColToHex

Convert a Color or a RGB-color Into Hex String
BubbleLegend

Add a Legend to a Bubble Plot
ColToRgb

Color to RGB Conversion
CollapseTable

Collapse Levels of a Table
CatTable

Function to write a table
CountWorkDays

Count Work Days Between Two Dates
Canvas

Canvas for Geometric Plotting
CohenKappa

Cohen's Kappa and Weighted Kappa
CronbachAlpha

Cronbach's Coefficient Alpha
CoefVar

Coefficient of Variation
Closest

Find the Closest Value
CohenD

Cohen's Effect Size
ConnLines

Add Connection Lines to a Barplot
CCC

Concordance Correlation Coefficient
ColToHsv

R Color to HSV Conversion
DigitSum

Calculate Digit Sum
ColToGrey

Convert Colors to Grey/Grayscale
CourseData

Get HWZ Datasets
CorPolychor

Polychoric Correlation
Cross

Vector Cross Product
ColumnWrap

Column Wrap
CramerVonMisesTest

Cramer-von Mises Test for Normality
ColorLegend

Add a ColorLegend to a Plot
Association measures

Cramer's V, Pearson's Contingency Coefficient and Phi Coefficient Yule's Q and Y, Tschuprow's T
CountCompCases

Count Complete Cases
Coalesce

Return the First Element Not Being NA
DivCoef

Rao's Diversity Coefficient
CompleteColumns

Find Complete Columns
ConoverTest

Conover's Test of Multiple Comparisons
DrawCircle

Draw a Circle
Cstat

C Statistic (Area Under the ROC Curve)
ConDisPairs

Concordant and Discordant Pairs
Date Functions

Basic Date Functions
Cor

Covariance and Correlation (Matrices)
CombPairs

Get All Pairs Out of One or Two Sets of Elements
CorPart

Find the Correlations for a Set x of Variables With Set y Removed
DegToRad

Convert Degrees to Radians and Vice Versa
Entropy

Shannon Entropy and Mutual Information
DrawEllipse

Draw an Ellipse
Divisors

Calculate Divisors
DenseRank

Dense Ranks and Percent Ranks
ConvUnit

Unit Conversion and Metrix Prefixes
Conf

Confusion Matrix And Associated Statistics
ExtrVal

Distributions of Maxima and Minima
CrossN

n-dimensional Vector Cross Product
Frechet

The Frechet Distribution
DescTools-package

Tools for Descriptive Statistics and Exploratory Data Analysis
DurbinWatsonTest

Durbin-Watson Test
DoCall

Fast Alternative To The Internal do.call
DescToolsOptions

DescTools Options
Desc

Describe Data
Factorize

Prime Factorization of Integers
DoBy

Evaluates a Function Groupwise
DivCoefMax

Maximal value of Rao's diversity coefficient also called quadratic entropy
FindColor

Get Color on a Defined Color Range
DrawBand

Draw Confidence Band
Contrasts

Pairwise Contrasts
Freq

Frequency Table for a Single Variable
FindCorr

Determine Highly Correlated Variables
FisherZ

Fisher-Transformation for Correlation to z-Score
DrawBezier

Draw a Bezier Curve
EtaSq

Effect Size Calculations for ANOVAs
Fibonacci

Fibonacci Numbers
FctArgs

Retrieve a Function's Arguments
Dot

Scalar Product
DrawRegPolygon

Draw Regular Polygon(s)
Format

Format Numbers and Dates
Freq2D

Bivariate (Two-Dimensional) Frequency Distribution
CutQ

Create a Factor Variable Using the Quantiles of a Continuous Variable
Frac

Fractional Part and Maximal Digits of a Numeric Value
Gmean

Geometric Mean and Standard Deviation
FixToTable

Convert a Text to a Table
GiniSimpson

Compute Gini-Simpson Coefficient
Gini

Gini Coefficient
Datasets for Simulation

Datasets for Probabilistic Simulation
Dummy

Generate Dummy Codes for a Factor
GeomSn

Geometric Series
DrawArc

Draw Elliptic Arc(s)
GenPareto

The Generalized Pareto Distribution
ExpFreq

Expected Frequencies
GCD, LCM

Greatest Common Divisor and Least Common Multiple
Gumbel

The Gumbel Distribution
Hmean

Harmonic Mean and Its Confidence Interval
Eps

Greenhouse-Geisser And Huynh-Feldt Epsilons
DunnettTest

Dunnett's Test for Comparing Several Treatments With a Control
ErrBars

Add Error Bars to an Existing Plot
HmsToSec

Convert h:m:s To/From Seconds
InDots

Is a Specific Argument in the Dots-Arguments?
GeomTrans

Geometric Transformations
GTest

G-Test for Count Data
GetNewWrd

Create a New Word Instance
DunnTest

Dunn's Test of Multiple Comparisons
IQRw

The (weighted) Interquartile Range
GenExtrVal

The Generalized Extreme Value Distribution
IsOdd

Checks If An Integer Is Even Or Odd
Herfindahl

Concentration Measures
Gompertz

The Gompertz distribution
GetCurrWrd

Get a Handle to a Running Word Instance
HexToCol

Identify Closest Match to a Color Given by a Hexadecimal String
IsDichotomous

Test If a Variable Contains Only Two Unique Values
IdentifyA

Identify Points in Plot Lying Within a Rectangle or Polygon
IsValidHwnd

Check Windows Pointer
IsEuclid

Is a Distance Matrix Euclidean?
GetNewXL

Create a New Excel Instance
HoeffD

Matrix of Hoeffding's D Statistics
HosmerLemeshowTest

Hosmer-Lemeshow Goodness of Fit Tests
GoodmanKruskalTau

Goodman Kruskal's Tau
Some numeric checks

Check a Vector For Being Numeric, Zero Or a Whole Number
HodgesLehmann

Hodges-Lehmann Estimator of Location
KappaM

Kappa for m Raters
GoodmanKruskalGamma

Goodman Kruskal's Gamma
HexToRgb

Convert a Hexstring Color to a Matrix With Three Red/Green/Blue Rows
ICC

Intraclass Correlations (ICC1, ICC2, ICC3 From Shrout and Fleiss)
HotellingsT2Test

Hotelling's T2 Test
HuberM

Safe (generalized) Huber M-Estimator of Location
KendallTauB

Kendall's \(\tau_{b}\)
IsDate

Check If an Object Is of Type Date
IsPrime

IsPrime Property
KendallTauA

Kendall's \(\tau_{a}\)
Measures of Accuracy

Measures of Accuracy
Lambda

Goodman Kruskal Lambda
Extremes

Kth Smallest/Largest Values
Lc

Lorenz Curve
Keywords

List Keywords For R Manual Pages
KendallW

Kendall's Coefficient of Concordance W
Mean

(Weighted) Arithmetic Mean
LogSt

Started Logarithmic Transformation and Its Inverse
Mar and Mgp

Set Plot Margins and Distances
MultinomCI

Confidence Intervals for Multinomial Proportions
MHChisqTest

Mantel-Haenszel Chi-Square Test
LOCF

Last Observation Carried Forward
ImputeKnn

Fill in NA values with the values of the nearest neighbours
KrippAlpha

Krippendorff's Alpha Reliability Coefficient
LeveneTest

Levene's Test for Homogeneity of Variance
Logit

Generalized Logit and Inverse Logit Function
LehmacherTest

Lehmacher's Test for Marginal Homogenity
JarqueBeraTest

(Robust) Jarque Bera Test
PlotCashFlow

Cash Flow Plot
PlotLog

Logarithmic Plot
PlotLinesA

Plot Lines
LillieTest

Lilliefors (Kolmogorov-Smirnov) Test for Normality
PlotMultiDens

Plot Multiple Density Curves
PlotViolin

Plot Violins Instead of Boxplots
PlotCirc

Plot Circular Plot
LineToUser

Convert Line Coordinates To User Coordinates
LinScale

Linear Scaling
PlotWeb

Plot a Web of Connected Points
MeanDiffCI

Confidence Interval For Difference of Means
NPV

Short Selection of Financial Mathematical Functions
PlotPairs

Extended Scatterplot Matrices
Label, Unit

Label, Unit Attribute of an Object
MeanSE

Standard Error of Mean
ParseSASDatalines

Parse a SAS Dataline Command
Outlier

Outlier
LOF

Local Outlier Factor
OddsRatio

Odds Ratio Estimation and Confidence Intervals
ParseFormula

Parse a Formula and Create a Model Frame
Midx

Find the Midpoints of a Numeric Vector
Rename

Change Names of a Named Object
JonckheereTerpstraTest

Exact Version of Jonckheere-Terpstra Test
Order

Distributions of Order Statistics
List Variety Of Objects

List Objects, Functions Or Data in a Package
Median

(Weighted) Median Value
MedianCI

Confidence Interval for the Median
MosesTest

Moses Test of Extreme Reactions
NemenyiTest

Nemenyi Test
ORToRelRisk

Transform Odds Ratio to Relative Risk
MAD

Median Absolute Deviation
MultMerge

Merge Multiple Data Frames
PMT

Periodic Payment of an Annuity.
MeanAD

Mean Absolute Deviation From a Center Point
PDFManual

Get PDF Manual of a Package From CRAN
PearsonTest

Pearson Chi-Square Test for Normality
MixColor

Compute the Convex Combination of Two Colors
Mode

Mode, Most Frequent Value(s)
RobScale

Robust Scaling With Median and Mad
Phrase

Phrasing Results of t-Test
PasswordDlg

Password Dialog
RomanToInt

Convert Roman Numerals to Integers
MeanCI

Confidence Interval for the Mean
PageTest

Exact Page Test for Ordered Alternatives
MoveAvg

Moving Average
DescTools Palettes

Some Custom Palettes
Permn

Number and Samples for Permutations or Combinations of a Set
PairApply

Pairwise Calculations
reorder.factor

Reorder the Levels of a Factor
PercTable

Percentage Table
PlotMarDens

Scatterplot With Marginal Densities
PlotACF

Combined Plot of a Time Series and Its ACF and PACF
PlotMiss

Plot Missing Data
SendOutlookMail

Send a Mail Using Outlook as Mail Client
Some

Return Some Randomly Chosen Elements of an Object
ScheffeTest

Scheffe Test for Pairwise and Otherwise Comparisons
PlotFdist

Frequency Distribution Plot
PlotBag

Bivariate Boxplot
PlotDot

Cleveland's Dot Plots
PlotArea

Create an Area Plot
PlotTreemap

Create a Treemap
PlotBubble

Draw a Bubble Plot
PlotCorr

Plot a Correlation Matrix
PlotCandlestick

Plot Candlestick Chart
PlotPolar

Plot Values on a Circular Grid
PlotVenn

Plot a Venn Diagram
PlotPyramid

Draw a Back To Back Pyramid Plot
StrChop

Split a String into a Number of Sections of Defined Length
PlotFun

Plot a Function
SomersDelta

Somers' Delta
RSessionAlive

How Long Has the RSession Been Running?
Primes

Find All Primes Less Than n
Quot

Lagged Quotients
PseudoR2

Pseudo R2 Statistics
PlotECDF

Empirical Cumulative Distribution Function
RndPairs

Create Pairs of Correlated Random Numbers
StrPos

Find Position of First Occurrence Of a String
PlotFaces

Chernoff Faces
RgbToCol

Find the Nearest Named R-Color to a Given RGB-Color
PtInPoly

Point in Polygon
Shade

Produce a Shaded Curve
ShapiroFranciaTest

Shapiro-Francia Test for Normality
Strata

Stratified Sampling
StrRev

Reverse a String
ToWrdB

Send Objects to Word and Bookmark Them
Quantile

Weighted Quantiles
PlotMonth

Plot Monthly or Seasonal Effects Of a Univariate Time Series
StrVal

Extract All Numeric Values From a String
PowerPoint Interface

Add Slides, Insert Texts and Plots to PowerPoint
PlotQQ

QQ-Plot for Any Distribution
PlotMosaic

Mosaic Plots
StrCountW

Count Words in a String
PlotTernary

Ternary or Triangular Plots
Recycle

Recyle a List of Elements
SignTest

Sign Test
PoissonCI

Poisson Confidence Interval
RelRisk

Relative Risk
Rev

Reverse Elements of a Vector or the Rows/Columns of Matrices, Tables or Data.frames
ToWrdPlot

Send a Plot to Word and Bookmark it
SiegelTukeyTest

Siegel-Tukey Test For Equality In Variability
PolarGrid

Plot a Grid in Polar Coordinates
pRevGumbel

"Reverse" Gumbel Distribution Functions
PostHocTest

Post-Hoc Tests
Range

(Robust) Range
Rotate

Rotate a Geometric Structure
RoundTo

Round to Multiple
RevWeibull

The Reverse Weibull Distribution
ColToOpaque

Equivalent Opaque Color for Transparent Color
SetAlpha

Add an Alpha Channel To a Color
Recode

Recode a Factor
StdCoef

Standardized Model Coefficients
SD

(Weighted) Standard Deviation
SetNames

Set the Names in an Object
VIF

Variance Inflation Factors
RunsTest

Runs Test for Randomness
Stamp

Date/Time/Directory Stamp the Current Plot
Unwhich

Inverse Which
StrTrunc

Truncate Strings and Add Ellipses If a String is Truncated.
SampleTwins

Sample Twins
WrdFormatCells

Format Cells Of a Word Table
StrTrim

Remove Leading/Trailing Whitespace From A String
XLGetRange

Import Data Directly From Excel
SaveAs

Saves an R Object Under a Different Name
SpearmanRho

Spearman Rank Correlation
Depreciation

Several Methods of Depreciation of an Asset
WrdInsertBookmark

Insert a Bookmark, Goto Bookmark and Update the Text of a Bookmark
d.diamonds

Data diamonds
SplitPath

Split Path In Drive, Path, Filename
XLDateToPOSIXct

Convert Excel Dates to POSIXct
DescTools Aliases

Some Aliases Set for Convenience
Sample

Random Samples and Permutations
SplitAt

Split a Vector Into Several Pieces at Given Positions
d.countries

ISO 3166-1 Country Codes
Sort

Sort a Vector, a Matrix, a Table or a Data.frame
matpow

Matrix Power
%c%

Concatenates Two Strings Without Any Separator
SpreadOut

Spread Out a Vector of Numbers To a Minimum Interval
StrPad

Pad a String With Justification
SysInfo

System Information
SortMixed

Sort Strings with Embedded Numbers Based on Their Numeric Order
TextToTable

Converts String To a Table
TextContrastColor

Choose Textcolor Depending on Background Color
Untable

Recover Original Data From Contingency Table
TwoGroups

Describe a Variable by a Factor with Two Levels
UncertCoef

Uncertainty Coefficient
Str

Compactly Display the Structure of any R Object
power.chisq.test

Power Calculations for ChiSquared Tests
StrIsNumeric

Does a String Contain Only Numeric Data
UnirootAll

Finds many (all) roots of one equation within an interval
ToLong, ToWide

Reshape a Vector From Long to Wide Shape Or Vice Versa
Measures of Shape

Skewness and Kurtosis
WrdCaption

Insert Caption to Word
StrDist

Compute Distances Between Strings
TMod

Comparison Table For Linear Models
ToWrd

Send Objects to Word
WrdBookmark

Return a Handle to a Word Bookmark Given as Name
StrAbbr

String Abbreviation
StrExtract

Extract Part of a String
WrdSaveAs

Open and Save Word Documents
VanWaerdenTest

van der Waerden Test
WrdStyle

Get or Set the Style in Word
Var

Variance
SmoothSpline

Formula Interface For smooth.spline
StrAlign

String Alignment
wdConst

Word VBA Constants
ZeroIfNA

Replace NAs by 0
StrCap

Capitalize the First Letter of a String
StrSpell

Spell a String Using the NATO Phonetic or the Morse Alphabet
TOne

Create Table One Describing Baseline Characteristics
split.formula

Formula Interface for Split
StrLeft, StrRight

Returns the Left Or the Right Part Of a String
%like%

Like Operator
identify.formula

Identify Points In a Plot Using a Formula
Zodiac

Calculate the Zodiac of a Date
WithOptions

Execute Function with Temporary Options
StuartMaxwellTest

Stuart-Maxwell Marginal Homogeneity Test
WoolfTest

Woolf Test For Homogeneity in 2x2xk Tables
WrdPlot

Insert Active Plot to Word
StuartTauC

Stuart \(\tau_{c}\)
Trim

Trim a Vector
TitleRect

Plot Boxed Annotation
TukeyBiweight

Calculate Tukey's Biweight Robust Mean
WrdParagraphFormat

Get or Set the Paragraph Format in Word
TTestA

Student's t-Test Based on Sample Statistics
VecRot

Vector Rotation (Shift Elements)
VarCI

Confidence Intervals for the Variance
Vigenere

Vigenere Cypher
TheilU

Theil's U Index of Inequality
XLSaveAs

Save Excel File
d.periodic

Periodic Table of Elements
VarTest

ChiSquare Test for One Variance and F Test to Compare Two Variances
d.pizza

Data pizza
Winsorize

Winsorize (Replace Extreme Values by Less Extreme Ones)
VonNeumannTest

Von Neumann's Successive Difference Test
XLView

Use MS-Excel as Viewer for a Data.Frame
WrdCellRange

Return the Cell Range Of a Word Table
WrdMergeCells

Merges Cells Of a Defined Word Table Range
WrdTable

Insert a Table in a Word Document
WrdTableBorders

Draw Borders to a Word Table
WrdPageBreak

Insert a Page Break
YuenTTest

Yuen t-Test For Trimmed Means
as.matrix.xtabs

Convert xtabs To matrix
WrdFont

Get or Set the Font in Word
ZTest

Z Test for Known Population Standard Deviation
lines.lm

Add a Linear Regression Line
day.name

Build-in Constants Extension
%nin%

Find Matching (or Non-Matching) Elements
axTicks.POSIXct

Compute Axis Tickmark Locations (For POSIXct Axis)
d.whisky

Classification of Scotch Single Malts
lines.loess

Add a Loess or a Spline Smoother
%overlaps%

Determines If And How Extensively Two Date Ranges Overlap
AddMonthsYM

Add a Month to a Date in YearMonth Format
Abstract

Display Compact Abstract of a Data Frame
Agree

Raw Simple And Extended Percentage Agreement
AllDuplicated

Index Vector of All Values Involved in Ties
AddMonths

Add a Month to a Date
AllIdentical

Test Multiple Objects for Exact Equality
AUC

Area Under the Curve
Append

Append Elements to Objects
AndersonDarlingTest

Anderson-Darling Test of Goodness-of-Fit