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.33

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Andri Signorell

Last Published

March 10th, 2020

Functions in DescTools (0.99.33)

Abind

Combine Multidimensional Arrays
AUC

Area Under the Curve
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
Atkinson

Atkinson Index - A Measure of Inequality.
AndersonDarlingTest

Anderson-Darling Test of Goodness-of-Fit
AddMonthsYM

Add a Month to a Date in YearMonth Format
Abstract

Display Compact Abstract of a Data Frame
BarText

Add the Value Labels to a Barplot
AxisBreak

Place a Break Mark on an Axis
BinomRatioCI

Confidence Intervals for the Ratio of Binomial and Multinomial Proportions
BartelsRankTest

Bartels Rank Test of Randomness
Arrow

Insert an Arrow Into a Plot
BarnardTest

Barnard's Unconditional Test
BinomDiffCI

Confidence Interval for a Difference of Binomials
Append

Append Elements to Objects
Asp

Get Aspect Ratio of the Current Plot
Benford

Benford's Distribution
Between, Outside

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

Breslow-Day Test for Homogeneity of the Odds Ratios
CohenD

Cohen's Effect Size
Assocs

Association Measures
AscToChar

Convert ASCII Codes to Characters and Vice Versa
Base Conversions

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

Color to RGB Conversion
CartToPol

Transform Cartesian to Polar/Spherical Coordinates and Vice Versa
BinTree

Binary Tree
BoxCox

Box Cox Transformation
BoxCoxLambda

Automatic Selection of Box Cox Transformation Parameter
CoefVar

Coefficient of Variation
CatTable

Function to write a table
BootCI

Simple Bootstrap Confidence Intervals
BoxedText

Add Text in a Box to a Plot
BinomCI

Confidence Intervals for Binomial Proportions
CCC

Concordance Correlation Coefficient
CollapseTable

Collapse Levels of a Table
CochranArmitageTest

Cochran-Armitage Test for Trend
BubbleLegend

Add a Legend to a Bubble Plot
BrierScore

Brier Score for Assessing Prediction Accuracy
BreuschGodfreyTest

Breusch-Godfrey Test
CochranQTest

Cochran's Q test
CorPart

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

Covariance and Correlation (Matrices)
ColorLegend

Add a ColorLegend to a Plot
ColToHex

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

Cronbach's Coefficient Alpha
Canvas

Canvas for Geometric Plotting
Clockwise

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

Vector Cross Product
Closest

Find the Closest Value
Coalesce

Return the First Element Not Being NA
CentralValue

Obtain statistic of centrality
ColToGrey

Convert Colors to Grey/Grayscale
ColToHsv

R Color to HSV Conversion
ConnLines

Add Connection Lines to a Barplot
CohenKappa

Cohen's Kappa and Weighted Kappa
Dot

Scalar Product
ConoverTest

Conover's Test of Multiple Comparisons
ColumnWrap

Column Wrap
ConDisPairs

Concordant and Discordant Pairs
CountCompCases

Count Complete Cases
CrossN

n-dimensional Vector Cross Product
CramerVonMisesTest

Cramer-von Mises Test for Normality
CorPolychor

Polychoric Correlation
CompleteColumns

Find Complete Columns
CountWorkDays

Count Work Days Between Two Dates
CourseData

Get HWZ Datasets
Association measures

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

Basic Date Functions
DoBy

Evaluates a Function Groupwise
Conf

Confusion Matrix And Associated Statistics
DegToRad

Convert Degrees to Radians and Vice Versa
Cstat

C Statistic (Area Under the ROC Curve)
DoCall

Fast Alternative To The Internal do.call
DrawArc

Draw Elliptic Arc(s)
Datasets for Simulation

Datasets for Probabilistic Simulation
CombPairs

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

Dunn's Test of Multiple Comparisons
DivCoefMax

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

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

Calculate Digit Sum
CutQ

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

Rao's Diversity Coefficient
Dummy

Generate Dummy Codes for a Factor
DrawBand

Draw Confidence Band
Eps

Greenhouse-Geisser And Huynh-Feldt Epsilons
ConvUnit

Unit Conversion and Metrix Prefixes
Contrasts

Pairwise Contrasts
DrawCircle

Draw a Circle
DrawRegPolygon

Draw Regular Polygon(s)
DenseRank

Dense Ranks and Percent Ranks
Divisors

Calculate Divisors
EtaSq

Effect Size Calculations for ANOVAs
ErrBars

Add Error Bars to an Existing Plot
DrawBezier

Draw a Bezier Curve
DescToolsOptions

DescTools Options
Desc

Describe Data
Gmean

Geometric Mean and Standard Deviation
DrawEllipse

Draw an Ellipse
DescTools-package

Tools for Descriptive Statistics and Exploratory Data Analysis
GTest

G-Test for Count Data
ExpFreq

Expected Frequencies
FindColor

Get Color on a Defined Color Range
HexToCol

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

Durbin-Watson Test
HexToRgb

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

Gini Coefficient
GenExtrVal

The Generalized Extreme Value Distribution
FixToTable

Convert a Text to a Table
FindCorr

Determine Highly Correlated Variables
Freq

Frequency Table for a Single Variable
Entropy

Shannon Entropy and Mutual Information
FisherZ

Fisher-Transformation for Correlation to z-Score
ExtrVal

Distributions of Maxima and Minima
Fibonacci

Fibonacci Numbers
GiniSimpson

Compute Gini-Simpson Coefficient
Frechet

The Frechet Distribution
Gompertz

The Gompertz distribution
GetNewWrd

Create a New Word Instance
IdentifyA

Identify Points in Plot Lying Within a Rectangle or Polygon
FctArgs

Retrieve a Function's Arguments
Hmean

Harmonic Mean and Its Confidence Interval
Frac

Fractional Part and Maximal Digits of a Numeric Value
IsValidHwnd

Check Windows Pointer
Factorize

Prime Factorization of Integers
IQRw

The (weighted) Interquartile Range
GCD, LCM

Greatest Common Divisor and Least Common Multiple
Format

Format Numbers and Dates
HoeffD

Matrix of Hoeffding's D Statistics
HmsToSec

Convert h:m:s To/From Seconds
GetNewXL

Create a New Excel Instance
InDots

Is a Specific Argument in the Dots-Arguments?
HodgesLehmann

Hodges-Lehmann Estimator of Location
Freq2D

Bivariate (Two-Dimensional) Frequency Distribution
GeomSn

Geometric Series
HuberM

Safe (generalized) Huber M-Estimator of Location
GeomTrans

Geometric Transformations
IsDate

Check If an Object Is of Type Date
Some numeric checks

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

Concentration Measures
IsOdd

Checks If An Integer Is Even Or Odd
GetCurrWrd

Get a Handle to a Running Word Instance
LehmacherTest

Lehmacher's Test for Marginal Homogenity
GoodmanKruskalGamma

Goodman Kruskal's Gamma
GenPareto

The Generalized Pareto Distribution
IsDichotomous

Test If a Variable Contains Only Two Unique Values
Measures of Accuracy

Measures of Accuracy
GoodmanKruskalTau

Goodman Kruskal's Tau
JonckheereTerpstraTest

Exact Version of Jonckheere-Terpstra Test
ICC

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

IsPrime Property
HotellingsT2Test

Hotelling's T2 Test
IsEuclid

Is a Distance Matrix Euclidean?
HosmerLemeshowTest

Hosmer-Lemeshow Goodness of Fit Tests
Mar and Mgp

Set Plot Margins and Distances
Gumbel

The Gumbel Distribution
ImputeKnn

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

Mantel-Haenszel Chi-Square Test
Lc

Lorenz Curve
JarqueBeraTest

(Robust) Jarque Bera Test
KappaM

Kappa for m Raters
KendallTauB

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

List Keywords For R Manual Pages
KendallW

Kendall's Coefficient of Concordance W
LinScale

Linear Scaling
LOF

Local Outlier Factor
Mean

(Weighted) Arithmetic Mean
LogSt

Started Logarithmic Transformation and Its Inverse
Mode

Mode, Most Frequent Value(s)
Extremes

Kth Smallest/Largest Values
KendallTauA

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

Confidence Interval for the Median
Label, Unit

Label, Unit Attribute of an Object
Logit

Generalized Logit and Inverse Logit Function
Lambda

Goodman Kruskal Lambda
Median

(Weighted) Median Value
LineToUser

Convert Line Coordinates To User Coordinates
List Variety Of Objects

List Objects, Functions Or Data in a Package
KrippAlpha

Krippendorff's Alpha Reliability Coefficient
MoveAvg

Moving Average
MosesTest

Moses Test of Extreme Reactions
OddsRatio

Odds Ratio Estimation and Confidence Intervals
PairApply

Pairwise Calculations
MixColor

Compute the Convex Combination of Two Colors
Midx

Find the Midpoints of a Numeric Vector
MeanCI

Confidence Interval for the Mean
ParseFormula

Parse a Formula and Create a Model Frame
MeanAD

Mean Absolute Deviation From a Center Point
MultMerge

Merge Multiple Data Frames
LillieTest

Lilliefors (Kolmogorov-Smirnov) Test for Normality
PDFManual

Get PDF Manual of a Package From CRAN
LeveneTest

Levene's Test for Homogeneity of Variance
LOCF

Last Observation Carried Forward
NemenyiTest

Nemenyi Test
PlotLinesA

Plot Lines
PlotACF

Combined Plot of a Time Series and Its ACF and PACF
DescTools Palettes

Some Custom Palettes
Outlier

Outlier
Phrase

Phrasing Results of t-Test
PlotLog

Logarithmic Plot
MeanDiffCI

Confidence Interval For Difference of Means
ORToRelRisk

Transform Odds Ratio to Relative Risk
PlotMonth

Plot Monthly or Seasonal Effects Of a Univariate Time Series
Order

Distributions of Order Statistics
PearsonTest

Pearson Chi-Square Test for Normality
MultinomCI

Confidence Intervals for Multinomial Proportions
PercTable

Percentage Table
PasswordDlg

Password Dialog
PlotMosaic

Mosaic Plots
PlotBubble

Draw a Bubble Plot
MeanSE

Standard Error of Mean
MAD

Median Absolute Deviation
ParseSASDatalines

Parse a SAS Dataline Command
PMT

Periodic Payment of an Annuity.
PlotBag

Bivariate Boxplot
PlotCorr

Plot a Correlation Matrix
PageTest

Exact Page Test for Ordered Alternatives
Permn

Number and Samples for Permutations or Combinations of a Set
NPV

Short Selection of Financial Mathematical Functions
PlotMarDens

Scatterplot With Marginal Densities
PlotCashFlow

Cash Flow Plot
PlotArea

Create an Area Plot
PoissonCI

Poisson Confidence Interval
PolarGrid

Plot a Grid in Polar Coordinates
PlotCirc

Plot Circular Plot
PlotCandlestick

Plot Candlestick Chart
PtInPoly

Point in Polygon
Quantile

Weighted Quantiles
PlotMiss

Plot Missing Data
PlotMultiDens

Plot Multiple Density Curves
RSessionAlive

How Long Has the RSession Been Running?
RevWeibull

The Reverse Weibull Distribution
Recycle

Recyle a List of Elements
PlotPairs

Extended Scatterplot Matrices
Quot

Lagged Quotients
PlotFdist

Frequency Distribution Plot
RelRisk

Relative Risk
ColToOpaque

Equivalent Opaque Color for Transparent Color
PlotFun

Plot a Function
SD

(Weighted) Standard Deviation
SampleTwins

Sample Twins
PlotPolar

Plot Values on a Circular Grid
PlotTernary

Ternary or Triangular Plots
PlotECDF

Empirical Cumulative Distribution Function
PlotPyramid

Draw a Back To Back Pyramid Plot
PseudoR2

Pseudo R2 Statistics
Primes

Find All Primes Less Than n
PlotQQ

QQ-Plot for Any Distribution
PlotDot

Cleveland's Dot Plots
RunsTest

Runs Test for Randomness
PlotFaces

Chernoff Faces
Rev

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

Saves an R Object Under a Different Name
pRevGumbel

"Reverse" Gumbel Distribution Functions
PlotWeb

Plot a Web of Connected Points
PlotViolin

Plot Violins Instead of Boxplots
PlotTreemap

Create a Treemap
SpearmanRho

Spearman Rank Correlation
SplitAt

Split a Vector Into Several Pieces at Given Positions
Range

(Robust) Range
Str

Compactly Display the Structure of any R Object
ScheffeTest

Scheffe Test for Pairwise and Otherwise Comparisons
RgbToCol

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

Send a Mail Using Outlook as Mail Client
Recode

Recode a Factor
PlotVenn

Plot a Venn Diagram
PowerPoint Interface

Add Slides, Insert Texts and Plots to PowerPoint
StrDist

Compute Distances Between Strings
PostHocTest

Post-Hoc Tests
Depreciation

Several Methods of Depreciation of an Asset
RndPairs

Create Pairs of Correlated Random Numbers
Shade

Produce a Shaded Curve
StrAbbr

String Abbreviation
RobScale

Robust Scaling With Median and Mad
RomanToInt

Convert Roman Numerals to Integers
Sample

Random Samples and Permutations
StrExtract

Extract Part of a String
Rename

Change Names of a Named Object
reorder.factor

Reorder the Levels of a Factor
SmoothSpline

Formula Interface For smooth.spline
SortMixed

Sort Strings with Embedded Numbers Based on Their Numeric Order
Sort

Sort a Vector, a Matrix, a Table or a Data.frame
Measures of Shape

Skewness and Kurtosis
ShapiroFranciaTest

Shapiro-Francia Test for Normality
TextContrastColor

Choose Textcolor Depending on Background Color
Rotate

Rotate a Geometric Structure
SignTest

Sign Test
TextToTable

Converts String To a Table
StrAlign

String Alignment
Stamp

Date/Time/Directory Stamp the Current Plot
SiegelTukeyTest

Siegel-Tukey Test For Equality In Variability
RoundTo

Round to Multiple
StrTrunc

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

Add an Alpha Channel To a Color
StrCap

Capitalize the First Letter of a String
StdCoef

Standardized Model Coefficients
StrTrim

Remove Leading/Trailing Whitespace From A String
SetNames

Set the Names in an Object
StrPos

Find Position of First Occurrence Of a String
StrChop

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

Reverse a String
Some

Return Some Randomly Chosen Elements of an Object
SomersDelta

Somers' Delta
ToWrdB

Send Objects to Word and Bookmark Them
StuartMaxwellTest

Stuart-Maxwell Marginal Homogeneity Test
TOne

Create Table One Describing Baseline Characteristics
ToWrdPlot

Send a Plot to Word and Bookmark it
StuartTauC

Stuart \(\tau_{c}\)
Unwhich

Inverse Which
VIF

Variance Inflation Factors
StrIsNumeric

Does a String Contain Only Numeric Data
StrCountW

Count Words in a String
SplitPath

Split Path In Drive, Path, Filename
TwoGroups

Describe a Variable by a Factor with Two Levels
WrdBookmark

Return a Handle to a Word Bookmark Given as Name
TTestA

Student's t-Test Based on Sample Statistics
UncertCoef

Uncertainty Coefficient
SpreadOut

Spread Out a Vector of Numbers To a Minimum Interval
UnirootAll

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

System Information
StrLeft, StrRight

Returns the Left Or the Right Part Of a String
StrSpell

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

Pad a String With Justification
WrdCaption

Insert Caption to Word
Untable

Recover Original Data From Contingency Table
TheilU

Theil's U Index of Inequality
TMod

Comparison Table For Linear Models
TitleRect

Plot Boxed Annotation
StrVal

Extract All Numeric Values From a String
VecRot

Vector Rotation (Shift Elements)
WrdMergeCells

Merges Cells Of a Defined Word Table Range
WoolfTest

Woolf Test For Homogeneity in 2x2xk Tables
ZeroIfNA

Replace NAs by 0
WrdPageBreak

Insert a Page Break
Zodiac

Calculate the Zodiac of a Date
WithOptions

Execute Function with Temporary Options
Strata

Stratified Sampling
Vigenere

Vigenere Cypher
ToLong, ToWide

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

Return the Cell Range Of a Word Table
WrdFont

Get or Set the Font in Word
d.pizza

Data pizza
d.periodic

Periodic Table of Elements
WrdTableBorders

Draw Borders to a Word Table
VarCI

Confidence Intervals for the Variance
Trim

Trim a Vector
VarTest

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

Send Objects to Word
WrdParagraphFormat

Get or Set the Paragraph Format in Word
as.matrix.xtabs

Convert xtabs To matrix
d.diamonds

Data diamonds
VonNeumannTest

Von Neumann's Successive Difference Test
WrdPlot

Insert Active Plot to Word
d.whisky

Classification of Scotch Single Malts
d.countries

ISO 3166-1 Country Codes
TukeyBiweight

Calculate Tukey's Biweight Robust Mean
WrdTable

Insert a Table in a Word Document
axTicks.POSIXct

Compute Axis Tickmark Locations (For POSIXct Axis)
Winsorize

Winsorize (Replace Extreme Values by Less Extreme Ones)
XLGetRange

Import Data Directly From Excel
lines.loess

Add a Loess or a Spline Smoother
XLDateToPOSIXct

Convert Excel Dates to POSIXct
VanWaerdenTest

van der Waerden Test
day.name

Build-in Constants Extension
DescTools Aliases

Some Aliases Set for Convenience
lines.lm

Add a Linear Regression Line
%nin%

Find Matching (or Non-Matching) Elements
ZTest

Z Test for Known Population Standard Deviation
YuenTTest

Yuen t-Test For Trimmed Means
%c%

Concatenates Two Strings Without Any Separator
wdConst

Word VBA Constants
WrdFormatCells

Format Cells Of a Word Table
WrdInsertBookmark

Insert a Bookmark, Goto Bookmark and Update the Text of a Bookmark
%overlaps%

Determines If And How Extensively Two Date Ranges Overlap
matpow

Matrix Power
Var

Variance
power.chisq.test

Power Calculations for ChiSquared Tests
WrdSaveAs

Open and Save Word Documents
split.formula

Formula Interface for Split
XLSaveAs

Save Excel File
WrdStyle

Get or Set the Style in Word
XLView

Use MS-Excel as Viewer for a Data.Frame
%like%

Like Operator
identify.formula

Identify Points In a Plot Using a Formula