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

97,236

Version

0.99.31

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Andri Signorell

Last Published

December 2nd, 2019

Functions in DescTools (0.99.31)

BinomRatioCI

Confidence Intervals for the Ratio of Binomial and Multinomial Proportions
BartelsRankTest

Bartels Rank Test of Randomness
Coalesce

Return the First Element Not Being NA
BootCI

Simple Bootstrap Confidence Intervals
BarnardTest

Barnard's Unconditional Test
Closest

Find the Closest Value
AscToChar

Convert ASCII Codes to Characters and Vice Versa
Assocs

Association Measures
Between, Outside

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

Binary Tree
ColToHsv

R Color to HSV Conversion
ConDisPairs

Concordant and Discordant Pairs
CCC

Concordance Correlation Coefficient
Atkinson

Atkinson Index - A Measure of Inequality.
ColToHex

Convert a Color Into Hex String
Cor

Correlation, Variance and Covariance (Matrices)
Conf

Confusion Matrix And Associated Statistics
BubbleLegend

Add a Legend to a Bubble Plot
CochranArmitageTest

Cochran-Armitage Test for Trend
CorPart

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

C Statistic (Area Under the ROC Curve)
CohenD

Cohen's Effect Size
Benford

Benford's Distribution
BinomCI

Confidence Intervals for Binomial Proportions
BinomDiffCI

Confidence Interval for a Difference of Binomials
Abind

Combine Multidimensional Arrays
BrierScore

Brier Score for Assessing Prediction Accuracy
CoefVar

Coefficient of Variation
BreuschGodfreyTest

Breusch-Godfrey Test
Base Conversions

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

Cochran's Q test
Asp

Get Aspect Ratio of the Current Plot
CutQ

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

The Generalized Pareto Distribution
Dummy

Generate Dummy Codes for a Factor
DunnTest

Dunn's Test of Multiple Comparisons
Divisors

Calculate Divisors
GenExtrVal

The Generalized Extreme Value Distribution
FixToTable

Convert a Text to a Table
DoBy

Evaluates a Function Groupwise
Format

Format Numbers and Dates
GiniSimpson

Compute Gini-Simpson Coefficient
CombPairs

Get All Pairs Out of One or Two Sets of Elements
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
CompleteColumns

Find Complete Columns
Desc

Describe Data
DescTools-package

Tools for Descriptive Statistics and Exploratory Data Analysis
CourseData

Get HWZ Datasets
EtaSq

Effect Size Calculations for ANOVAs
Dot

Scalar Product
DoCall

Fast Alternative To The Internal do.call
ErrBars

Add Error Bars to an Existing Plot
ExpFreq

Expected Frequencies
Gmean

Geometric Mean and Standard Deviation
BoxedText

Add Text in a Box to a Plot
BarText

Add the Value Labels to a Barplot
AxisBreak

Place a Break Mark on an Axis
BoxCox

Box Cox Transformation
ExtrVal

Distributions of Maxima and Minima
BoxCoxLambda

Automatic Selection of Box Cox Transformation Parameter
HotellingsT2Test

Hotelling's T2 Test
BreslowDayTest

Breslow-Day Test for Homogeneity of the Odds Ratios
Canvas

Canvas for Geometric Plotting
CartToPol

Transform Cartesian to Polar/Spherical Coordinates and Vice Versa
KendallTauA

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

Safe (generalized) Huber M-Estimator of Location
IdentifyA

Identify Points in Plot Lying Within a Rectangle or Polygon
InDots

Is a Specific Argument in the Dots-Arguments?
LehmacherTest

Lehmacher's Test for Marginal Homogenity
Lc

Lorenz Curve
List Variety Of Objects

List Objects, Functions Or Data in a Package
MAD

Median Absolute Deviation
KendallTauB

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

Column Wrap
MultMerge

Merge Multiple Data Frames
GCD, LCM

Greatest Common Divisor and Least Common Multiple
MoveAvg

Moving Average
CohenKappa

Cohen's Kappa and Weighted Kappa
ColToGrey

Convert Colors to Grey/Grayscale
CatTable

Function to write a table
OddsRatio

Odds Ratio Estimation and Confidence Intervals
Clockwise

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

Password Dialog
PearsonTest

Pearson Chi-Square Test for Normality
Order

Distributions of Order Statistics
PlotBubble

Draw a Bubble Plot
GTest

G-Test for Count Data
PlotCandlestick

Plot Candlestick Chart
ConoverTest

Conover's Test of Multiple Comparisons
ConnLines

Add Connection Lines to a Barplot
PlotFdist

Frequency Distribution Plot
ColToRgb

Color to RGB Conversion
PlotFun

Plot a Function
CorPolychor

Polychoric Correlation
CronbachAlpha

Cronbach's Coefficient Alpha
CramerVonMisesTest

Cramer-von Mises Test for Normality
CountCompCases

Count Complete Cases
DegToRad

Convert Degrees to Radians and Vice Versa
GoodmanKruskalTau

Goodman Kruskal's Tau
Gumbel

The Gumbel Distribution
DurbinWatsonTest

Durbin-Watson Test
FindColor

Get Color on a Defined Color Range
DunnettTest

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

Draw Elliptic Arc(s)
Frac

Fractional Part and Maximal Digits of a Numeric Value
DrawBand

Draw Confidence Band
Datasets for Simulation

Datasets for Probabilistic Simulation
DenseRank

Dense Ranks and Percent Ranks
Date Functions

Basic Date Functions
Fibonacci

Fibonacci Numbers
Contrasts

Pairwise Contrasts
CollapseTable

Collapse Levels of a Table
DrawCircle

Draw a Circle
DrawRegPolygon

Draw Regular Polygon(s)
DrawEllipse

Draw an Ellipse
DrawBezier

Draw a Bezier Curve
Factorize

Prime Factorization of Integers
Frechet

The Frechet Distribution
Freq

Frequency Table for a Single Variable
ConvUnit

Unit Conversion and Metrix Prefixes
FctArgs

Retrieve a Function's Arguments
GetNewXL

Create a New Excel Instance
Freq2D

Bivariate (Two-Dimensional) Frequency Distribution
IsDate

Check If an Object Is of Type Date
HodgesLehmann

Hodges-Lehmann Estimator of Location
IsDichotomous

Test If a Variable Contains Only Two Unique Values
HmsToSec

Convert h:m:s To/From Seconds
KendallW

Kendall's Coefficient of Concordance W
Cross

Vector Cross Product
Gompertz

The Gompertz distribution
Gini

Gini Coefficient
Extremes

Kth Smallest/Largest Values
IsPrime

IsPrime Property
Herfindahl

Concentration Measures
LOCF

Last Observation Carried Forward
HexToCol

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

Goodman Kruskal Lambda
IsValidHwnd

Check Windows Pointer
Mar and Mgp

Set Plot Margins and Distances
KrippAlpha

Krippendorff's Alpha Reliability Coefficient
Mean

(Weighted) Arithmetic Mean
DescToolsOptions

DescTools Options
CrossN

n-dimensional Vector Cross Product
Midx

Find the Midpoints of a Numeric Vector
MixColor

Compute the Convex Combination of Two Colors
DigitSum

Calculate Digit Sum
Range

(Robust) Range
Quot

Lagged Quotients
PlotPolar

Plot Values on a Circular Grid
PlotPyramid

Draw a Back To Back Pyramid Plot
LeveneTest

Levene's Test for Homogeneity of Variance
Keywords

List Keywords For R Manual Pages
Outlier

Outlier
DivCoef

Rao's Diversity Coefficient
LillieTest

Lilliefors (Kolmogorov-Smirnov) Test for Normality
RobScale

Robust Scaling With Median and Mad
Entropy

Shannon Entropy and Mutual Information
DivCoefMax

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

Greenhouse-Geisser And Huynh-Feldt Epsilons
Measures of Accuracy

Measures of Accuracy
MHChisqTest

Mantel-Haenszel Chi-Square Test
FindCorr

Determine Highly Correlated Variables
RomanToInt

Convert Roman Numerals to Integers
FisherZ

Fisher-Transformation for Correlation to z-Score
SetNames

Set the Names in an Object
SplitPath

Split Path In Drive, Path, Filename
Mode

Mode, Most Frequent Value(s)
SaveAs

Saves an R Object Under a Different Name
SampleTwins

Sample Twins
GeomSn

Geometric Series
SetAlpha

Add an Alpha Channel To a Color
MosesTest

Moses Test of Extreme Reactions
SpreadOut

Spread Out a Vector of Numbers To a Minimum Interval
MultinomCI

Confidence Intervals for Multinomial Proportions
PDFManual

Get PDF Manual of a Package From CRAN
NPV

Short Selection of Financial Mathematical Functions
PercTable

Percentage Table
PlotCirc

Plot Circular Plot
PlotCashFlow

Cash Flow Plot
Permn

Number and Samples for Permutations or Combinations of a Set
PlotArea

Create an Area Plot
PairApply

Pairwise Calculations
DescTools Palettes

Some Custom Palettes
PlotMonth

Plot Monthly or Seasonal Effects Of a Univariate Time Series
PlotBag

Bivariate Boxplot
StrAlign

String Alignment
PlotLinesA

Plot Lines
GeomTrans

Geometric Transformations
GoodmanKruskalGamma

Goodman Kruskal's Gamma
StrCap

Capitalize the First Letter of a String
Strata

Stratified Sampling
PlotLog

Logarithmic Plot
StrVal

Extract All Numeric Values From a String
PseudoR2

Pseudo R2 Statistics
PlotQQ

QQ-Plot for Any Distribution
PlotTernary

Ternary or Triangular Plots
Primes

Find All Primes Less Than n
RgbToCol

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

Mosaic Plots
GetCurrWrd

Get a Handle to a Running Word Instance
HexToRgb

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

Create a New Word Instance
Depreciation

Several Methods of Depreciation of an Asset
RndPairs

Create Pairs of Correlated Random Numbers
Some

Return Some Randomly Chosen Elements of an Object
Sample

Random Samples and Permutations
SomersDelta

Somers' Delta
Str

Compactly Display the Structure of any R Object
PlotTreemap

Create a Treemap
PlotVenn

Plot a Venn Diagram
ICC

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

Harmonic Mean and Its Confidence Interval
ToLong, ToWide

Reshape a Vector From Long to Wide Shape Or Vice Versa
Some numeric checks

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

String Abbreviation
IQRw

The (weighted) Interquartile Range
Trim

Trim a Vector
ToWrd

Send Objects to Word
HoeffD

Matrix of Hoeffding's D Statistics
PtInPoly

Point in Polygon
LinScale

Linear Scaling
LogSt

Started Logarithmic Transformation and Its Inverse
StrChop

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

(Robust) Jarque Bera Test
LineToUser

Convert Line Coordinates To User Coordinates
HosmerLemeshowTest

Hosmer-Lemeshow Goodness of Fit Tests
WithOptions

Execute Function with Temporary Options
TukeyBiweight

Calculate Tukey's Biweight Robust Mean
Quantile

Weighted Quantiles
StrCountW

Count Words in a String
WoolfTest

Woolf Test For Homogeneity in 2x2xk Tables
StuartTauC

Stuart \(\tau_{c}\)
TheilU

Theil's U Index of Inequality
StuartMaxwellTest

Stuart-Maxwell Marginal Homogeneity Test
%like%

Like Operator
identify.formula

Identify Points In a Plot Using a Formula
WrdSaveAs

Open and Save Word Documents
XLSaveAs

Save Excel File
WrdStyle

Get or Set the Style in Word
XLView

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

Confidence Intervals for the Variance
Logit

Generalized Logit and Inverse Logit Function
VarTest

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

Return a Handle to a Word Bookmark Given as Name
TitleRect

Plot Boxed Annotation
Rename

Change Names of a Named Object
RoundTo

Round to Multiple
IsEuclid

Is a Distance Matrix Euclidean?
Rotate

Rotate a Geometric Structure
RelRisk

Relative Risk
SiegelTukeyTest

Siegel-Tukey Test For Equality In Variability
IsOdd

Checks If An Integer Is Even Or Odd
KappaM

Kappa for m Raters
Label, Unit

Label, Unit Attribute of an Object
MeanCI

Confidence Interval for the Mean
LOF

Local Outlier Factor
JonckheereTerpstraTest

Exact Version of Jonckheere-Terpstra Test
MeanDiffCI

Confidence Interval For Difference of Means
MeanSE

Standard Error of Mean
MeanAD

Mean Absolute Deviation From a Center Point
WrdCaption

Insert Caption to Word
SignTest

Sign Test
Median

(Weighted) Median Value
NemenyiTest

Nemenyi Test
MedianCI

Confidence Interval for the Median
ParseFormula

Parse a Formula and Create a Model Frame
PlotECDF

Empirical Cumulative Distribution Function
PlotFaces

Chernoff Faces
PMT

Periodic Payment of an Annuity.
ParseSASDatalines

Parse a SAS Dataline Command
PageTest

Exact Page Test for Ordered Alternatives
PlotMarDens

Scatterplot With Marginal Densities
ORToRelRisk

Transform Odds Ratio to Relative Risk
Phrase

Phrasing Results of t-Test
PlotACF

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

Insert a Table in a Word Document
Recode

Recode a Factor
PlotViolin

Plot Violins Instead of Boxplots
PlotWeb

Plot a Web of Connected Points
pRevGumbel

"Reverse" Gumbel Distribution Functions
PlotMiss

Plot Missing Data
Recycle

Recyle a List of Elements
Stamp

Date/Time/Directory Stamp the Current Plot
PlotCorr

Plot a Correlation Matrix
RevWeibull

The Reverse Weibull Distribution
RunsTest

Runs Test for Randomness
StdCoef

Standardized Model Coefficients
YuenTTest

Yuen t-Test For Trimmed Means
d.countries

ISO 3166-1 Country Codes
%nin%

Find Matching (or Non-Matching) Elements
WrdTableBorders

Draw Borders to a Word Table
d.diamonds

Data diamonds
ZTest

Z Test for Known Population Standard Deviation
PlotDot

Cleveland's Dot Plots
PlotMultiDens

Plot Multiple Density Curves
PlotPairs

Extended Scatterplot Matrices
PoissonCI

Poisson Confidence Interval
%overlaps%

Determines If And How Extensively Two Date Ranges Overlap
PolarGrid

Plot a Grid in Polar Coordinates
reorder.factor

Reorder the Levels of a Factor
ScheffeTest

Scheffe Test for Pairwise and Otherwise Comparisons
PowerPoint Interface

Add Slides, Insert Texts and Plots to PowerPoint
PostHocTest

Post-Hoc Tests
Rev

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

(Weighted) Standard Deviation
StrIsNumeric

Does a String Contain Only Numeric Data
SendOutlookMail

Send a Mail Using Outlook as Mail Client
StrPad

Pad a String With Justification
SysInfo

System Information
Shade

Produce a Shaded Curve
Sort

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

Shapiro-Francia Test for Normality
StrPos

Find Position of First Occurrence Of a String
SortMixed

Sort Strings with Embedded Numbers Based on Their Numeric Order
TMod

Comparison Table For Linear Models
TOne

Create Table One Describing Baseline Characteristics
TTestA

Student's t-Test Based on Sample Statistics
TwoGroups

Describe a Variable by a Factor with Two Levels
UncertCoef

Uncertainty Coefficient
Measures of Shape

Skewness and Kurtosis
SmoothSpline

Formula Interface For smooth.spline
StrRev

Reverse a String
StrTrunc

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

Remove Leading/Trailing Whitespace From A String
ToWrdPlot

Send a Plot to Word and Bookmark it
VecRot

Vector Rotation (Shift Elements)
Unwhich

Inverse Which
ToWrdB

Send Objects to Word and Bookmark Them
VIF

Variance Inflation Factors
WrdCellRange

Return the Cell Range Of a Word Table
WrdPlot

Insert Active Plot to Word
WrdParagraphFormat

Get or Set the Paragraph Format in Word
ZeroIfNA

Replace NAs by 0
Vigenere

Vigenere Cypher
SplitAt

Split a Vector Into Several Pieces at Given Positions
SpearmanRho

Spearman Rank Correlation
StrDist

Compute Distances Between Strings
StrExtract

Extract Part of a String
Zodiac

Calculate the Zodiac of a Date
DescTools Aliases

Some Aliases Set for Convenience
day.name

Build-in Constants Extension
matpow

Matrix Power
d.whisky

Classification of Scotch Single Malts
StrSpell

Spell a String Using the NATO Phonetic or the Morse Alphabet
StrLeft, StrRight

Returns the Left Or the Right Part Of a String
WrdPageBreak

Insert a Page Break
TextToTable

Converts String To a Table
VonNeumannTest

Von Neumann's Successive Difference Test
TextContrastColor

Choose Textcolor Depending on Background Color
UnirootAll

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

Winsorize (Replace Extreme Values by Less Extreme Ones)
Untable

Recover Original Data From Contingency Table
WrdMergeCells

Merges Cells Of a Defined Word Table Range
WrdFont

Get or Set the Font in Word
WrdFormatCells

Format Cells Of a Word Table
WrdInsertBookmark

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

Convert Excel Dates to POSIXct
XLGetRange

Import Data Directly From Excel
%c%

Concatenates Two Strings Without Any Separator
lines.lm

Add a Linear Regression Line
lines.loess

Add a Loess or a Spline Smoother
power.chisq.test

Power Calculations for ChiSquared Tests
as.matrix.xtabs

Convert xtabs To matrix
axTicks.POSIXct

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

Periodic Table of Elements
d.pizza

Data pizza
split.formula

Formula Interface for Split
wdConst

Word VBA Constants
AddMonthsYM

Add a Month to a Date in YearMonth Format
Agree

Raw Simple And Extended Percentage Agreement
Arrow

Insert an Arrow Into a Plot
AndersonDarlingTest

Anderson-Darling Test of Goodness-of-Fit
Append

Append Elements to Objects
Abstract

Display Compact Abstract of a Data Frame
AUC

Area Under the Curve
AddMonths

Add a Month to a Date
AllDuplicated

Index Vector of All Values Involved in Ties