Learn R Programming

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

DescTools

Tools for Descriptive Statistics and Exploratory Data Analysis

Copy Link

Version

Install

install.packages('DescTools')

Monthly Downloads

81,849

Version

0.99.32

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Andri Signorell

Last Published

January 17th, 2020

Functions in DescTools (0.99.32)

AndersonDarlingTest

Anderson-Darling Test of Goodness-of-Fit
BarText

Add the Value Labels to a Barplot
AddMonths

Add a Month to a Date
AxisBreak

Place a Break Mark on an Axis
Abstract

Display Compact Abstract of a Data Frame
Benford

Benford's Distribution
Base Conversions

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

Area Under the Curve
Agree

Raw Simple And Extended Percentage Agreement
BartelsRankTest

Bartels Rank Test of Randomness
AddMonthsYM

Add a Month to a Date in YearMonth Format
BarnardTest

Barnard's Unconditional Test
BinomRatioCI

Confidence Intervals for the Ratio of Binomial and Multinomial Proportions
Abind

Combine Multidimensional Arrays
BoxedText

Add Text in a Box to a Plot
Between, Outside

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

Binary Tree
AscToChar

Convert ASCII Codes to Characters and Vice Versa
Append

Append Elements to Objects
BreslowDayTest

Breslow-Day Test for Homogeneity of the Odds Ratios
CartToPol

Transform Cartesian to Polar/Spherical Coordinates and Vice Versa
Canvas

Canvas for Geometric Plotting
Coalesce

Return the First Element Not Being NA
BrierScore

Brier Score for Assessing Prediction Accuracy
BreuschGodfreyTest

Breusch-Godfrey Test
Arrow

Insert an Arrow Into a Plot
Assocs

Association Measures
Atkinson

Atkinson Index - A Measure of Inequality.
BootCI

Simple Bootstrap Confidence Intervals
ColumnWrap

Column Wrap
CombPairs

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

Cochran-Armitage Test for Trend
CorPart

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

Get Aspect Ratio of the Current Plot
CoefVar

Coefficient of Variation
BoxCox

Box Cox Transformation
BoxCoxLambda

Automatic Selection of Box Cox Transformation Parameter
CochranQTest

Cochran's Q test
CatTable

Function to write a table
CentralValue

Obtain statistic of centrality
CorPolychor

Polychoric Correlation
BinomCI

Confidence Intervals for Binomial Proportions
BinomDiffCI

Confidence Interval for a Difference of Binomials
Closest

Find the Closest Value
CohenKappa

Cohen's Kappa and Weighted Kappa
CohenD

Cohen's Effect Size
Clockwise

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

Conover's Test of Multiple Comparisons
CutQ

Create a Factor Variable Using the Quantiles of a Continuous Variable
Datasets for Simulation

Datasets for Probabilistic Simulation
BubbleLegend

Add a Legend to a Bubble Plot
CCC

Concordance Correlation Coefficient
ColToHsv

R Color to HSV Conversion
Dot

Scalar Product
DrawArc

Draw Elliptic Arc(s)
CountCompCases

Count Complete Cases
CompleteColumns

Find Complete Columns
ColToRgb

Color to RGB Conversion
CourseData

Get HWZ Datasets
ConDisPairs

Concordant and Discordant Pairs
DescTools-package

Tools for Descriptive Statistics and Exploratory Data Analysis
Contrasts

Pairwise Contrasts
CronbachAlpha

Cronbach's Coefficient Alpha
ColToGrey

Convert Colors to Grey/Grayscale
CollapseTable

Collapse Levels of a Table
ColToHex

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

Vector Cross Product
Cor

Correlation, Variance and Covariance (Matrices)
Conf

Confusion Matrix And Associated Statistics
ConnLines

Add Connection Lines to a Barplot
ConvUnit

Unit Conversion and Metrix Prefixes
Date Functions

Basic Date Functions
Desc

Describe Data
DenseRank

Dense Ranks and Percent Ranks
DurbinWatsonTest

Durbin-Watson Test
Entropy

Shannon Entropy and Mutual Information
CramerVonMisesTest

Cramer-von Mises Test for Normality
ColorLegend

Add a ColorLegend to a Plot
Cstat

C Statistic (Area Under the ROC Curve)
DrawCircle

Draw a Circle
DoBy

Evaluates a Function Groupwise
DoCall

Fast Alternative To The Internal do.call
Association measures

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

n-dimensional Vector Cross Product
DegToRad

Convert Degrees to Radians and Vice Versa
DescToolsOptions

DescTools Options
DrawEllipse

Draw an Ellipse
ExtrVal

Distributions of Maxima and Minima
DivCoefMax

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

Expected Frequencies
Dummy

Generate Dummy Codes for a Factor
EtaSq

Effect Size Calculations for ANOVAs
Divisors

Calculate Divisors
GenPareto

The Generalized Pareto Distribution
DrawRegPolygon

Draw Regular Polygon(s)
FisherZ

Fisher-Transformation for Correlation to z-Score
DrawBand

Draw Confidence Band
GeomSn

Geometric Series
DrawBezier

Draw a Bezier Curve
Factorize

Prime Factorization of Integers
Fibonacci

Fibonacci Numbers
ErrBars

Add Error Bars to an Existing Plot
Frechet

The Frechet Distribution
Herfindahl

Concentration Measures
Eps

Greenhouse-Geisser And Huynh-Feldt Epsilons
Gumbel

The Gumbel Distribution
FctArgs

Retrieve a Function's Arguments
GoodmanKruskalGamma

Goodman Kruskal's Gamma
GoodmanKruskalTau

Goodman Kruskal's Tau
InDots

Is a Specific Argument in the Dots-Arguments?
GenExtrVal

The Generalized Extreme Value Distribution
GTest

G-Test for Count Data
GeomTrans

Geometric Transformations
GetCurrWrd

Get a Handle to a Running Word Instance
Hmean

Harmonic Mean and Its Confidence Interval
Freq

Frequency Table for a Single Variable
DigitSum

Calculate Digit Sum
DivCoef

Rao's Diversity Coefficient
GetNewWrd

Create a New Word Instance
DunnTest

Dunn's Test of Multiple Comparisons
DunnettTest

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

Create a New Excel Instance
HuberM

Safe (generalized) Huber M-Estimator of Location
ICC

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

Convert h:m:s To/From Seconds
JarqueBeraTest

(Robust) Jarque Bera Test
Lc

Lorenz Curve
JonckheereTerpstraTest

Exact Version of Jonckheere-Terpstra Test
FindColor

Get Color on a Defined Color Range
HexToCol

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

Lehmacher's Test for Marginal Homogenity
Measures of Accuracy

Measures of Accuracy
FindCorr

Determine Highly Correlated Variables
Mode

Mode, Most Frequent Value(s)
MHChisqTest

Mantel-Haenszel Chi-Square Test
Format

Format Numbers and Dates
MosesTest

Moses Test of Extreme Reactions
Order

Distributions of Order Statistics
HexToRgb

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

Identify Points in Plot Lying Within a Rectangle or Polygon
Keywords

List Keywords For R Manual Pages
OddsRatio

Odds Ratio Estimation and Confidence Intervals
IQRw

The (weighted) Interquartile Range
Frac

Fractional Part and Maximal Digits of a Numeric Value
Gini

Gini Coefficient
IsDate

Check If an Object Is of Type Date
GiniSimpson

Compute Gini-Simpson Coefficient
ParseFormula

Parse a Formula and Create a Model Frame
IsEuclid

Is a Distance Matrix Euclidean?
IsDichotomous

Test If a Variable Contains Only Two Unique Values
KendallTauA

Kendall's \(\tau_{a}\)
HodgesLehmann

Hodges-Lehmann Estimator of Location
HoeffD

Matrix of Hoeffding's D Statistics
KappaM

Kappa for m Raters
ImputeKnn

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

Local Outlier Factor
KendallTauB

Kendall's \(\tau_{b}\)
Label, Unit

Label, Unit Attribute of an Object
MixColor

Compute the Convex Combination of Two Colors
LinScale

Linear Scaling
NemenyiTest

Nemenyi Test
LineToUser

Convert Line Coordinates To User Coordinates
Midx

Find the Midpoints of a Numeric Vector
Phrase

Phrasing Results of t-Test
ORToRelRisk

Transform Odds Ratio to Relative Risk
ParseSASDatalines

Parse a SAS Dataline Command
KendallW

Kendall's Coefficient of Concordance W
KrippAlpha

Krippendorff's Alpha Reliability Coefficient
PlotACF

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

Number and Samples for Permutations or Combinations of a Set
PlotCashFlow

Cash Flow Plot
PercTable

Percentage Table
Quot

Lagged Quotients
PlotVenn

Plot a Venn Diagram
PlotMiss

Plot Missing Data
PlotMarDens

Scatterplot With Marginal Densities
PlotCirc

Plot Circular Plot
PlotTreemap

Create a Treemap
LOCF

Last Observation Carried Forward
PlotFdist

Frequency Distribution Plot
PlotQQ

QQ-Plot for Any Distribution
Primes

Find All Primes Less Than n
PseudoR2

Pseudo R2 Statistics
Logit

Generalized Logit and Inverse Logit Function
PlotTernary

Ternary or Triangular Plots
PlotFun

Plot a Function
LogSt

Started Logarithmic Transformation and Its Inverse
Range

(Robust) Range
ColToOpaque

Equivalent Opaque Color for Transparent Color
PDFManual

Get PDF Manual of a Package From CRAN
LillieTest

Lilliefors (Kolmogorov-Smirnov) Test for Normality
MeanSE

Standard Error of Mean
MeanDiffCI

Confidence Interval For Difference of Means
MAD

Median Absolute Deviation
LeveneTest

Levene's Test for Homogeneity of Variance
PasswordDlg

Password Dialog
List Variety Of Objects

List Objects, Functions Or Data in a Package
Outlier

Outlier
RgbToCol

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

Random Samples and Permutations
Rev

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

Reorder the Levels of a Factor
FixToTable

Convert a Text to a Table
SampleTwins

Sample Twins
PlotECDF

Empirical Cumulative Distribution Function
PlotArea

Create an Area Plot
PlotViolin

Plot Violins Instead of Boxplots
PlotWeb

Plot a Web of Connected Points
PlotBag

Bivariate Boxplot
PlotFaces

Chernoff Faces
PearsonTest

Pearson Chi-Square Test for Normality
Freq2D

Bivariate (Two-Dimensional) Frequency Distribution
PoissonCI

Poisson Confidence Interval
MeanAD

Mean Absolute Deviation From a Center Point
ShapiroFranciaTest

Shapiro-Francia Test for Normality
SortMixed

Sort Strings with Embedded Numbers Based on Their Numeric Order
StrDist

Compute Distances Between Strings
GCD, LCM

Greatest Common Divisor and Least Common Multiple
SpearmanRho

Spearman Rank Correlation
SiegelTukeyTest

Siegel-Tukey Test For Equality In Variability
Gmean

Geometric Mean and Standard Deviation
StrCountW

Count Words in a String
MeanCI

Confidence Interval for the Mean
MoveAvg

Moving Average
PolarGrid

Plot a Grid in Polar Coordinates
StuartMaxwellTest

Stuart-Maxwell Marginal Homogeneity Test
Strata

Stratified Sampling
HosmerLemeshowTest

Hosmer-Lemeshow Goodness of Fit Tests
Gompertz

The Gompertz distribution
PairApply

Pairwise Calculations
DescTools Palettes

Some Custom Palettes
Depreciation

Several Methods of Depreciation of an Asset
SD

(Weighted) Standard Deviation
MultMerge

Merge Multiple Data Frames
StuartTauC

Stuart \(\tau_{c}\)
HotellingsT2Test

Hotelling's T2 Test
RelRisk

Relative Risk
PlotCandlestick

Plot Candlestick Chart
PlotBubble

Draw a Bubble Plot
SetNames

Set the Names in an Object
SignTest

Sign Test
Rename

Change Names of a Named Object
RndPairs

Create Pairs of Correlated Random Numbers
Measures of Shape

Skewness and Kurtosis
Shade

Produce a Shaded Curve
RobScale

Robust Scaling With Median and Mad
SpreadOut

Spread Out a Vector of Numbers To a Minimum Interval
SmoothSpline

Formula Interface For smooth.spline
IsOdd

Checks If An Integer Is Even Or Odd
IsPrime

IsPrime Property
PlotLinesA

Plot Lines
StrChop

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

Capitalize the First Letter of a String
Some

Return Some Randomly Chosen Elements of an Object
PlotMultiDens

Plot Multiple Density Curves
PostHocTest

Post-Hoc Tests
Recode

Recode a Factor
PlotPairs

Extended Scatterplot Matrices
PowerPoint Interface

Add Slides, Insert Texts and Plots to PowerPoint
PlotLog

Logarithmic Plot
Stamp

Date/Time/Directory Stamp the Current Plot
IsValidHwnd

Check Windows Pointer
StdCoef

Standardized Model Coefficients
Recycle

Recyle a List of Elements
Some numeric checks

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

Winsorize (Replace Extreme Values by Less Extreme Ones)
ToWrd

Send Objects to Word
SysInfo

System Information
WithOptions

Execute Function with Temporary Options
ToWrdB

Send Objects to Word and Bookmark Them
RoundTo

Round to Multiple
Lambda

Goodman Kruskal Lambda
StrTrunc

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

Kth Smallest/Largest Values
Str

Compactly Display the Structure of any R Object
Mar and Mgp

Set Plot Margins and Distances
SaveAs

Saves an R Object Under a Different Name
RunsTest

Runs Test for Randomness
WrdMergeCells

Merges Cells Of a Defined Word Table Range
WrdInsertBookmark

Insert a Bookmark, Goto Bookmark and Update the Text of a Bookmark
Mean

(Weighted) Arithmetic Mean
Median

(Weighted) Median Value
MedianCI

Confidence Interval for the Median
MultinomCI

Confidence Intervals for Multinomial Proportions
StrSpell

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

Remove Leading/Trailing Whitespace From A String
StrVal

Extract All Numeric Values From a String
PMT

Periodic Payment of an Annuity.
NPV

Short Selection of Financial Mathematical Functions
PageTest

Exact Page Test for Ordered Alternatives
PlotCorr

Plot a Correlation Matrix
PlotDot

Cleveland's Dot Plots
TOne

Create Table One Describing Baseline Characteristics
TTestA

Student's t-Test Based on Sample Statistics
TMod

Comparison Table For Linear Models
ToWrdPlot

Send a Plot to Word and Bookmark it
ScheffeTest

Scheffe Test for Pairwise and Otherwise Comparisons
PlotMosaic

Mosaic Plots
PlotPyramid

Draw a Back To Back Pyramid Plot
PlotMonth

Plot Monthly or Seasonal Effects Of a Univariate Time Series
PlotPolar

Plot Values on a Circular Grid
RevWeibull

The Reverse Weibull Distribution
Quantile

Weighted Quantiles
pRevGumbel

"Reverse" Gumbel Distribution Functions
PtInPoly

Point in Polygon
TextContrastColor

Choose Textcolor Depending on Background Color
SomersDelta

Somers' Delta
StrExtract

Extract Part of a String
StrRev

Reverse a String
TextToTable

Converts String To a Table
TheilU

Theil's U Index of Inequality
Sort

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

Does a String Contain Only Numeric Data
StrLeft, StrRight

Returns the Left Or the Right Part Of a String
Vigenere

Vigenere Cypher
Trim

Trim a Vector
RomanToInt

Convert Roman Numerals to Integers
Untable

Recover Original Data From Contingency Table
VIF

Variance Inflation Factors
VarCI

Confidence Intervals for the Variance
WrdPageBreak

Insert a Page Break
Unwhich

Inverse Which
d.whisky

Classification of Scotch Single Malts
d.pizza

Data pizza
WrdStyle

Get or Set the Style in Word
WrdTable

Insert a Table in a Word Document
VonNeumannTest

Von Neumann's Successive Difference Test
Rotate

Rotate a Geometric Structure
SendOutlookMail

Send a Mail Using Outlook as Mail Client
DescTools Aliases

Some Aliases Set for Convenience
WrdParagraphFormat

Get or Set the Paragraph Format in Word
split.formula

Formula Interface for Split
XLDateToPOSIXct

Convert Excel Dates to POSIXct
WrdTableBorders

Draw Borders to a Word Table
Zodiac

Calculate the Zodiac of a Date
power.chisq.test

Power Calculations for ChiSquared Tests
as.matrix.xtabs

Convert xtabs To matrix
WrdCaption

Insert Caption to Word
SetAlpha

Add an Alpha Channel To a Color
WrdCellRange

Return the Cell Range Of a Word Table
StrAlign

String Alignment
StrPos

Find Position of First Occurrence Of a String
StrPad

Pad a String With Justification
SplitPath

Split Path In Drive, Path, Filename
SplitAt

Split a Vector Into Several Pieces at Given Positions
XLView

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

String Abbreviation
TitleRect

Plot Boxed Annotation
ToLong, ToWide

Reshape a Vector From Long to Wide Shape Or Vice Versa
UncertCoef

Uncertainty Coefficient
%nin%

Find Matching (or Non-Matching) Elements
UnirootAll

Finds many (all) roots of one equation within an interval
%like%

Like Operator
wdConst

Word VBA Constants
lines.lm

Add a Linear Regression Line
axTicks.POSIXct

Compute Axis Tickmark Locations (For POSIXct Axis)
YuenTTest

Yuen t-Test For Trimmed Means
d.countries

ISO 3166-1 Country Codes
TukeyBiweight

Calculate Tukey's Biweight Robust Mean
VarTest

ChiSquare Test for One Variance and F Test to Compare Two Variances
VecRot

Vector Rotation (Shift Elements)
TwoGroups

Describe a Variable by a Factor with Two Levels
WrdPlot

Insert Active Plot to Word
WrdBookmark

Return a Handle to a Word Bookmark Given as Name
WrdFormatCells

Format Cells Of a Word Table
XLSaveAs

Save Excel File
day.name

Build-in Constants Extension
XLGetRange

Import Data Directly From Excel
identify.formula

Identify Points In a Plot Using a Formula
WoolfTest

Woolf Test For Homogeneity in 2x2xk Tables
WrdFont

Get or Set the Font in Word
%overlaps%

Determines If And How Extensively Two Date Ranges Overlap
WrdSaveAs

Open and Save Word Documents
ZTest

Z Test for Known Population Standard Deviation
ZeroIfNA

Replace NAs by 0
d.diamonds

Data diamonds
%c%

Concatenates Two Strings Without Any Separator
lines.loess

Add a Loess or a Spline Smoother
d.periodic

Periodic Table of Elements
matpow

Matrix Power
AllDuplicated

Index Vector of All Values Involved in Ties