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

79,502

Version

0.99.30

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

October 22nd, 2019

Functions in DescTools (0.99.30)

AxisBreak

Place a Break Mark on an Axis
Between, Outside

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

Add a Month to a Date in YearMonth Format
BubbleLegend

Add a Legend to a Bubble Plot
BinTree

Binary Tree
ColToHsv

R Color to HSV Conversion
CCC

Concordance Correlation Coefficient
ColorLegend

Add a ColorLegend to a Plot
Abstract

Display Compact Abstract of a Data Frame
ColToHex

Convert a Color Into Hex String
Append

Append Elements to Objects
Closest

Find the Closest Value
Arrow

Insert an Arrow Into a Plot
Agree

Raw Simple And Extended Percentage Agreement
Coalesce

Return the First Element Not Being NA
CourseData

Get HWZ Datasets
Association measures

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

Column Wrap
CochranQTest

Cochran's Q test
Contrasts

Pairwise Contrasts
CochranArmitageTest

Cochran-Armitage Test for Trend
CramerVonMisesTest

Cramer-von Mises Test for Normality
ConvUnit

Unit Conversion and Metrix Prefixes
AscToChar

Convert ASCII Codes to Characters and Vice Versa
Asp

Get Aspect Ratio of the Current Plot
Clockwise

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

Cohen's Effect Size
CompleteColumns

Find Complete Columns
BinomRatioCI

Confidence Intervals for the Ratio of Binomial and Multinomial Proportions
CoefVar

Coefficient of Variation
DrawArc

Draw Elliptic Arc(s)
CatTable

Function to write a table
BootCI

Simple Bootstrap Confidence Intervals
CombPairs

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

Barnard's Unconditional Test
Assocs

Association Measures
DescToolsOptions

DescTools Options
AddMonths

Add a Month to a Date
BinomCI

Confidence Intervals for Binomial Proportions
BreuschGodfreyTest

Breusch-Godfrey Test
BinomDiffCI

Confidence Interval for a Difference of Binomials
Date Functions

Basic Date Functions
Datasets for Simulation

Datasets for Probabilistic Simulation
CronbachAlpha

Cronbach's Coefficient Alpha
DrawBand

Draw Confidence Band
DigitSum

Calculate Digit Sum
Divisors

Calculate Divisors
ExpFreq

Expected Frequencies
DunnettTest

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

Distributions of Maxima and Minima
DurbinWatsonTest

Durbin-Watson Test
DoBy

Evaluates a Function Groupwise
BartelsRankTest

Bartels Rank Test of Randomness
BrierScore

Brier Score for Assessing Prediction Accuracy
GenExtrVal

The Generalized Extreme Value Distribution
GenPareto

The Generalized Pareto Distribution
ConnLines

Add Connection Lines to a Barplot
CorPolychor

Polychoric Correlation
ConoverTest

Conover's Test of Multiple Comparisons
GiniSimpson

Compute Gini-Simpson Coefficient
BoxCox

Box Cox Transformation
CountCompCases

Count Complete Cases
HodgesLehmann

Hodges-Lehmann Estimator of Location
Gmean

Geometric Mean and Standard Deviation
HmsToSec

Convert h:m:s To/From Seconds
HuberM

Safe (generalized) Huber M-Estimator of Location
IsDichotomous

Test If a Variable Contains Only Two Unique Values
GoodmanKruskalTau

Goodman Kruskal's Tau
HotellingsT2Test

Hotelling's T2 Test
Gumbel

The Gumbel Distribution
DivCoef

Rao's Diversity Coefficient
DegToRad

Convert Degrees to Radians and Vice Versa
DenseRank

Dense Ranks and Percent Ranks
DoCall

Fast Alternative To The Internal do.call
Dot

Scalar Product
Atkinson

Atkinson Index - A Measure of Inequality.
BoxedText

Add Text in a Box to a Plot
BreslowDayTest

Breslow-Day Test for Homogeneity of the Odds Ratios
CartToPol

Transform Cartesian to Polar/Spherical Coordinates and Vice Versa
BoxCoxLambda

Automatic Selection of Box Cox Transformation Parameter
Canvas

Canvas for Geometric Plotting
ColToRgb

Color to RGB Conversion
Dummy

Generate Dummy Codes for a Factor
CohenKappa

Cohen's Kappa and Weighted Kappa
ConDisPairs

Concordant and Discordant Pairs
IsEuclid

Is a Distance Matrix Euclidean?
CollapseTable

Collapse Levels of a Table
DivCoefMax

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

Add Error Bars to an Existing Plot
FindCorr

Determine Highly Correlated Variables
DunnTest

Dunn's Test of Multiple Comparisons
Conf

Confusion Matrix And Associated Statistics
Keywords

List Keywords For R Manual Pages
FisherZ

Fisher-Transformation for Correlation to z-Score
CrossN

n-dimensional Vector Cross Product
DrawCircle

Draw a Circle
DescTools-package

Tools for Descriptive Statistics and Exploratory Data Analysis
Factorize

Prime Factorization of Integers
DrawEllipse

Draw an Ellipse
DrawRegPolygon

Draw Regular Polygon(s)
Cross

Vector Cross Product
DrawBezier

Draw a Bezier Curve
Desc

Describe Data
EtaSq

Effect Size Calculations for ANOVAs
FctArgs

Retrieve a Function's Arguments
ColToGrey

Convert Colors to Grey/Grayscale
KrippAlpha

Krippendorff's Alpha Reliability Coefficient
GCD, LCM

Greatest Common Divisor and Least Common Multiple
CutQ

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

Correlation, Variance and Covariance (Matrices)
Cstat

C Statistic (Area Under the ROC Curve)
CorPart

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

Shannon Entropy and Mutual Information
Fibonacci

Fibonacci Numbers
GTest

G-Test for Count Data
Label, Unit

Label, Unit Attribute of an Object
GeomTrans

Geometric Transformations
HexToRgb

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

Get a Handle to a Running Word Instance
GetNewWrd

Create a New Word Instance
FindColor

Get Color on a Defined Color Range
GeomSn

Geometric Series
Lambda

Goodman Kruskal Lambda
IsPrime

IsPrime Property
IsOdd

Checks If An Integer Is Even Or Odd
LillieTest

Lilliefors (Kolmogorov-Smirnov) Test for Normality
Mean

(Weighted) Arithmetic Mean
Eps

Greenhouse-Geisser And Huynh-Feldt Epsilons
MeanSE

Standard Error of Mean
MeanAD

Mean Absolute Deviation From a Center Point
Hmean

Harmonic Mean and Its Confidence Interval
Median

(Weighted) Median Value
FixToTable

Convert a Text to a Table
LinScale

Linear Scaling
Freq

Frequency Table for a Single Variable
Frechet

The Frechet Distribution
Format

Format Numbers and Dates
Frac

Fractional Part and Maximal Digits of a Numeric Value
Freq2D

Bivariate (Two-Dimensional) Frequency Distribution
PlotCandlestick

Plot Candlestick Chart
PlotFdist

Frequency Distribution Plot
Phrase

Phrasing Results of t-Test
Permn

Number and Samples for Permutations or Combinations of a Set
PlotCashFlow

Cash Flow Plot
GetNewXL

Create a New Excel Instance
PlotFun

Plot a Function
HosmerLemeshowTest

Hosmer-Lemeshow Goodness of Fit Tests
HoeffD

Matrix of Hoeffding's D Statistics
Logit

Generalized Logit and Inverse Logit Function
IsDate

Check If an Object Is of Type Date
LOCF

Last Observation Carried Forward
InDots

Is a Specific Argument in the Dots-Arguments?
LineToUser

Convert Line Coordinates To User Coordinates
LOF

Local Outlier Factor
List Variety Of Objects

List Objects, Functions Or Data in a Package
LogSt

Started Logarithmic Transformation and Its Inverse
IdentifyA

Identify Points in Plot Lying Within a Rectangle or Polygon
ICC

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

Confidence Interval for the Median
Order

Distributions of Order Statistics
Midx

Find the Midpoints of a Numeric Vector
Outlier

Outlier
DescTools Palettes

Some Custom Palettes
PlotVenn

Plot a Venn Diagram
JonckheereTerpstraTest

Exact Version of Jonckheere-Terpstra Test
LehmacherTest

Lehmacher's Test for Marginal Homogenity
JarqueBeraTest

(Robust) Jarque Bera Test
Gini

Gini Coefficient
Herfindahl

Concentration Measures
GoodmanKruskalGamma

Goodman Kruskal's Gamma
HexToCol

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

The Gompertz distribution
ParseFormula

Parse a Formula and Create a Model Frame
PlotWeb

Plot a Web of Connected Points
Quantile

Weighted Quantiles
PlotViolin

Plot Violins Instead of Boxplots
Quot

Lagged Quotients
IsValidHwnd

Check Windows Pointer
PoissonCI

Poisson Confidence Interval
Some numeric checks

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

Robust Scaling With Median and Mad
SendOutlookMail

Send a Mail Using Outlook as Mail Client
RndPairs

Create Pairs of Correlated Random Numbers
SetAlpha

Add an Alpha Channel To a Color
SpearmanRho

Spearman Rank Correlation
SortMixed

Sort Strings with Embedded Numbers Based on Their Numeric Order
Shade

Produce a Shaded Curve
ToWrd

Send Objects to Word
ToWrdB

Send Objects to Word and Bookmark Them
SetNames

Set the Names in an Object
UncertCoef

Uncertainty Coefficient
RelRisk

Relative Risk
Recycle

Recyle a List of Elements
LeveneTest

Levene's Test for Homogeneity of Variance
RevWeibull

The Reverse Weibull Distribution
MixColor

Compute the Convex Combination of Two Colors
MAD

Median Absolute Deviation
Measures of Accuracy

Measures of Accuracy
MosesTest

Moses Test of Extreme Reactions
MoveAvg

Moving Average
WrdTableBorders

Draw Borders to a Word Table
WrdFont

Get or Set the Font in Word
UnirootAll

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

Format Cells Of a Word Table
Mode

Mode, Most Frequent Value(s)
SaveAs

Saves an R Object Under a Different Name
RgbToCol

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

Formula Interface For smooth.spline
MeanDiffCI

Confidence Interval For Difference of Means
ScheffeTest

Scheffe Test for Pairwise and Otherwise Comparisons
KendallW

Kendall's Coefficient of Concordance W
KendallTauB

Kendall Tau-b
MeanCI

Confidence Interval for the Mean
MultMerge

Merge Multiple Data Frames
Some

Return Some Randomly Chosen Elements of an Object
KappaM

Kappa for m Raters
PDFManual

Get PDF Manual of a Package From CRAN
XLDateToPOSIXct

Convert Excel Dates to POSIXct
ZTest

Z Test for Known Population Standard Deviation
ZeroIfNA

Replace NAs by 0
d.pizza

Data pizza
StrPad

Pad a String With Justification
d.whisky

Classification of Scotch Single Malts
MultinomCI

Confidence Intervals for Multinomial Proportions
KendallTauA

Kendall's Tau-a
PlotECDF

Empirical Cumulative Distribution Function
PlotFaces

Chernoff Faces
NemenyiTest

Nemenyi Test
StuartMaxwellTest

Stuart-Maxwell Marginal Homogeneity Test
StrPos

Find Position of First Occurrence Of a String
NPV

Short Selection of Financial Mathematical Functions
TextToTable

Converts String To a Table
Strata

Stratified Sampling
TheilU

Theil's U Index of Inequality
Untable

Recover Original Data From Contingency Table
PlotTreemap

Create a Treemap
RunsTest

Runs Test for Randomness
PlotPolar

Plot Values on a Circular Grid
SiegelTukeyTest

Siegel-Tukey Test For Equality In Variability
PlotTernary

Ternary or Triangular Plots
RoundTo

Round to Multiple
ShapiroFranciaTest

Shapiro-Francia Test for Normality
StdCoef

Standardized Model Coefficients
PlotMultiDens

Plot Multiple Density Curves
Str

Compactly Display the Structure of any R Object
PageTest

Exact Page Test for Ordered Alternatives
PlotCirc

Plot Circular Plot
ParseSASDatalines

Parse a SAS Dataline Command
PolarGrid

Plot a Grid in Polar Coordinates
PlotLinesA

Plot Lines
PasswordDlg

Password Dialog
PlotCorr

Plot a Correlation Matrix
PMT

Periodic Payment of an Annuity.
PlotLog

Logarithmic Plot
PostHocTest

Post-Hoc Tests
Extremes

Kth Smallest/Largest Values
PseudoR2

Pseudo R2 Statistics
PtInPoly

Point in Polygon
StrChop

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

Capitalize the First Letter of a String
StrTrunc

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

Transform Odds Ratio to Relative Risk
PearsonTest

Pearson Chi-Square Test for Normality
MHChisqTest

Mantel-Haenszel Chi-Square Test
StrVal

Extract All Numeric Values From a String
Lc

Lorenz Curve
Mar

Set Plot Margins
OddsRatio

Odds Ratio Estimation and Confidence Intervals
Rename

Change Names of a Named Object
reorder.factor

Reorder the Levels of a Factor
SplitAt

Split a Vector Into Several Pieces at Given Positions
TTestA

Student's t-Test Based on Sample Statistics
TextContrastColor

Choose Textcolor Depending on Background Color
TwoGroups

Describe a Variable by a Factor with Two Levels
WrdCellRange

Return the Cell Range Of a Word Table
TukeyBiweight

Calculate Tukey's Biweight Robust Mean
WrdInsertBookmark

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

Insert Caption to Word
PercTable

Percentage Table
WrdPageBreak

Insert a Page Break
Unwhich

Inverse Which
WrdParagraphFormat

Get or Set the Paragraph Format in Word
WrdMergeCells

Merges Cells Of a Defined Word Table Range
PlotBag

Bivariate Boxplot
SplitPath

Split Path In Drive, Path, Filename
XLSaveAs

Save Excel File
d.diamonds

Data diamonds
PlotACF

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

Pairwise Calculations
XLGetRange

Import Data Directly From Excel
PlotArea

Create an Area Plot
StrCountW

Count Words in a String
StrDist

Compute Distances Between Strings
Zodiac

Calculate the Zodiac of a Date
d.periodic

Periodic Table of Elements
StrSpell

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

Plot to Device
PlotBubble

Draw a Bubble Plot
PlotDot

Cleveland's Dot Plots
PowerPoint Interface

Add Slides, Insert Texts and Plots to PowerPoint
as.matrix.xtabs

Convert xtabs To matrix
PlotMarDens

Scatterplot With Marginal Densities
matpow

Matrix Power
lines.loess

Add a Loess or a Spline Smoother
PlotMiss

Plot Missing Data
StrTrim

Remove Leading/Trailing Whitespace From A String
DescTools Aliases

Some Aliases Set for Convenience
%nin%

Find Matching (or Non-Matching) Elements
wdConst

Word VBA Constants
Rev

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

(Weighted) Standard Deviation
SignTest

Sign Test
Measures of Shape

Skewness and Kurtosis
Depreciation

Several Methods of Depreciation of an Asset
pRevGumbel

"Reverse" Gumbel Distribution Functions
Primes

Find All Primes Less Than n
SpreadOut

Spread Out a Vector of Numbers To a Minimum Interval
VarTest

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

Plot Monthly or Seasonal Effects Of a Univariate Time Series
Stamp

Date/Time/Directory Stamp the Current Plot
Winsorize

Winsorize (Replace Extreme Values by Less Extreme Ones)
WrdStyle

Get or Set the Style in Word
XLView

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

Vector Rotation (Shift Elements)
WrdTable

Insert a Table in a Word Document
WithOptions

Execute Function with Temporary Options
StrLeft, StrRight

Returns the Left Or the Right Part Of a String
StrRev

Reverse a String
TMod

Comparison Table For Linear Models
PlotMosaic

Mosaic Plots
YuenTTest

Yuen t-Test For Trimmed Means
PlotPyramid

Draw a Back To Back Pyramid Plot
TitleRect

Plot Boxed Annotation
TOne

Create Table One Describing Baseline Characteristics
VarCI

Confidence Intervals for the Variance
PlotQQ

QQ-Plot for Any Distribution
WrdBookmark

Return a Handle to a Word Bookmark Given as Name
ToLong, ToWide

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

Woolf Test For Homogeneity in 2x2xk Tables
VIF

Variance Inflation Factors
day.name

Build-in Constants Extension
identify.formula

Identify Points In a Plot Using a Formula
power.chisq.test

Power Calculations for ChiSquared Tests
split.formula

Formula Interface for Split
Range

(Robust) Range
Recode

Recode a Factor
Sort

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

Somers' Delta
SampleTwins

Sample Twins
StrAlign

String Alignment
RomanToInt

Convert Roman Numerals to Integers
Rotate

Rotate a Geometric Structure
StrAbbr

String Abbreviation
Sample

Random Samples and Permutations
StrIsNumeric

Does a String Contain Only Numeric Data
StrExtract

Extract Part of a String
StuartTauC

Stuart \(\tau_{c}\)
SysInfo

System Information
ToWrdPlot

Send a Plot to Word and Bookmark it
WrdPlot

Insert Active Plot to Word
Vigenere

Vigenere Cypher
Trim

Trim a Vector
VonNeumannTest

Von Neumann's Successive Difference Test
WrdSaveAs

Open and Save Word Documents
d.countries

ISO 3166-1 Country Codes
axTicks.POSIXct

Compute Axis Tickmark Locations (For POSIXct Axis)
%like%

Like Operator
lines.lm

Add a Linear Regression Line
%overlaps%

Determines If And How Extensively Two Date Ranges Overlap
%c%

Concatenates Two Strings Without Any Separator
AllDuplicated

Index Vector of All Values Involved in Ties
AndersonDarlingTest

Anderson-Darling Test of Goodness-of-Fit
BarText

Add the Value Labels to a Barplot
AUC

Area Under the Curve
Abind

Combine Multidimensional Arrays
Benford

Benford's Distribution
Base Conversions

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