Learn R Programming

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

DescTools (version 0.99.7)

Tools for descriptive statistics

Description

DescTools contains a bunch of basic statistic functions and convenience wrappers for efficiently describing data, creating specific plots, doing reports using MS Word, Excel or PowerPoint. The package's intention is to offer a toolbox, which facilitates the (notoriously time consuming) first descriptive tasks in data analysis, consisting of calculating descriptive statistics, drawing graphical summaries and reporting the results. Many of the included functions can be found scattered in other packages and other sources written partly by Titans of R. The reason for collecting them here, was primarily to have them consolidated in ONE instead of dozens of packages (which themselves might depend on other packages which are not needed at all), and to provide a common and consistent interface as far as function and arguments naming, NA handling, recycling rules etc. are concerned. Google style guides were used as naming rules (in absence of convincing alternatives). The 'camel style' was consequently applied to functions borrowed from contributed R packages as well.

Copy Link

Version

Install

install.packages('DescTools')

Monthly Downloads

104,795

Version

0.99.7

License

GPL (>= 2)

Maintainer

Andri Signorell

Last Published

May 4th, 2014

Functions in DescTools (0.99.7)

Atkinson

Calculate the Atkinson Index
AddLoess

Add a Loess Smoother
CartToPol

Transform Cartesian to Polar Coordinates and vice versa
Between

Between Operators Check, if a Value Lies Within a Given Range
BinomDiffCI

Confidence Interval for a Difference of Binomials
AddConnLines

Add Connection Lines to a Barplot
AddMonths

Add a Month to a Date
SetAlpha

Add an Alpha Channel To a Color
BoxCox

Box Cox Transformation
AreaIdent

Identify Points in Plot Lying within a Rectangle or Polygon
AllDuplicated

Index Vector of All Values Involved in Ties
DrawArc

Draw Elliptic or Circular Arc(s)
ColToGrey

Convert Colors to Grey/Grayscale
DescTools-internal

Internal DescTools objects
BreslowDayTest

Breslow-Day Test for Homogeneity of the Odds Ratios
GetNewWrd

Create a new Word Instance
BinToDec

Converts numbers from binmode, octmode or hexmode to decimal and vice versa
Desc.Date

Describe a Date Vector
Canvas

Canvas for Geometric Plotting
DrawCircle

Draw a Circle
AddLm

Add a Linear Regression Line
AscToChar

Converts ASCII Codes to Characters and Vice Versa
CramerV

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

Create a Date from Numeric Representation
DrawAnnulusSector

Draw a Sector of an Annulus
Fibonacci

Fibonacci Series
BinomCI

Confidence Intervals for Binomial Proportions
Dummy

Generate Dummy Codes for a Factor
CohenKappa

Cohen's Kappa and Weighted Kappa
HexToRgb

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

Anderson-Darling test for normality
AUC

Area Under the Curve
LeveneTest

Levene's Test for Homogeneity of Variance
GetNewPP

Create a new PowerPoint Instance
Desc.numeric

Describe a numeric vector
Freq

Frequency Table
GetPairs

Get All Pairs out of one or two Sets of Elements
AddErrBars

Add Error Bars to an Existing Plot
ParseFormula

Parse a Formula and Create a Model Frame
ConDisPairs

Concordant and Discordant Pairs
LillieTest

Lilliefors (Kolmogorov-Smirnov) test for normality
KendallTauB

Kendall tau-b
Coalesce

Return the First Element Not Being NA
ExpFreq

Expected frequencies
Partial

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

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

Place a Break Mark on an Axis
GiniSimpson

Compute Gini-Simpson Coefficient
IsWhole

Is x a Whole Number?
DivCoefMax

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

Describe Data
CramerVonMisesTest

Cramer-von Mises test for normality
ClipToVect

Reformat a Table in the Clipboard as Vector
Logit

Generalized Logit and Inverse Logit function
BoxedText

Add Text in a Box to a Plot
BoxCoxLambda

Automatic selection of Box Cox transformation parameter
LsFct

List Functions of a Package
PlotCandlestick

Plot Candlestick Chart
GetNewXL

Create a new Excel Instance
PlotACF

Combined Plot of a Time Series and it's ACF and PACF
KendallW

Kendall's Coefficient of Concordance W
Desc.integer

Describe an integer variable
GetCurrWrd

Get a Handle to a Running Word Instance
DescWrd

Use Word as Reporting Tool for Describing Data
CronbachAlpha

Cronbach's Coefficient Alpha
MeanDiffCI

Confidence Intervals for Difference of Means
HighLow

Return the Lowest and the Highest Values and Their Frequencies
Desc.logical

Describe a dichotomous variable
FormatFix

Format to a fixed format representation
ChooseColorDlg

Display Color Dialog to Choose a Color
PlotPolar

Plot Values on a Circular Grid
JonckheereTerpstraTest

Exact Version of Jonckheere-Terpstra Test
PlotMatrix

Scatterplot Matrix
GetAllSubsets

Get All Subsets out of a List of Elements
Large

Kth Smallest/Largest Values
CochranQTest

Cochran's Q test
MultinomCI

Confidence Intervals for Multinomial Proportions
PlotTreemap

Create a Treemap
ImportDlg

Get Path of a Data File to Be Opened
LogLin

Log Linear Hybrid, Generalized Log
DrawBand

Draw Confidence Band
PoissonCI

Poisson Confidence Interval
Mode

Mode
PlotMonth

Plot Monthly or Seasonal Effects Of a Univariate Time Series
CochranArmitageTest

Cochran-Armitage test for trend
IsValidWrd

Check Word Pointer
FindColor

Get Color on a Defined Color Range
ColToHsv

R Color to HSV Conversion
PolarGrid

Plot a Grid in Polar Coordinates
DrawEllipse

Draw an Ellipse
SelectVarDlg

Select Elements of a Set by Click
StrRev

Reverse a String
MoveAvg

Moving Average
FixToTab

Text to Table
FisherZ

Fisher r to z and z to r and confidence intervals
ColToHex

Convert a Color into Hex String
SiegelTukeyTest

Siegel-Tukey Test for equality in variability
HuberM

Safe (generalized) Huber M-Estimator of Location
Ndec

Count Decimal Places of a Number
Primes

Find all Primes Less Than n
PlotFdist

Frequency Distribution Plot
PlotCorr

Plot a Correlation Matrix
StrVal

Extract All Numbers From a String
PlotRCol

Information plots
DescTools-package

Tools for Efficient Descriptive Statistics
CatTable

Function to write a table
Clockwise

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

Color to RGB Conversion
LogSt

Started Logarithmic Transformation and It's Inverse
WrdPlot

Insert Active Plot to Word
MeanCI

Confidence Interval for the Mean
Ray

Compact Information About the Columns of a Data Frame
Kappam

Kappa for m raters
MeanAD

Mean Absolute Deviation From a Center Point
MosesTest

Moses Test of Extreme Reactions
StrIsNumeric

Does a String Contain Only Numeric Data
Hmean

Harmonic mean
Lc

Lorenz Curve
StrCountW

Count Words in a String
WrdTable

Produces a Table in Word
WrdCaption

Insert Caption to Word
DrawAnnulus

Draw One or Several Annuli
FormatSig

Significance Representation of a P-Value
WoolfTest

Woolf Test
DivCoef

Rao's diversity coefficient also called quadratic entropy
Midx

Find the Midpoints of a Numeric Vector
OddsRatio

Odds Ratio Estimation and Confidence Intervals
PageTest

Exact Page Test for Ordered Alternatives
Label

Label Attribute of an Object
Mbind

Bind k nxm-matrices with the same dimension
PlotDotCIp

Plot a Dotchart with Binomial Confidence Intervals
SomersDelta

Somers' Delta
PalDescTools

Some Custom Palettes
CutQ

Build Quantile Groups for a Numeric Variable
XLGetRange

Get the Values of Cell Range(s) in Excel
IsEuclid

Is a Distance Matrix Euclidean?
Gmean

Geometric Mean and Standard Deviation
day.name

Build-in Constants Extension
Frac

Return the Fractional Part of a Numeric Value
%nin%

Find Matching (or Non-Matching) Elements
Desc.data.frame

Describe a data.frame, a list or a matrix
PpPlot

Add Slides, Insert Texts and Plots to PowerPoint
PlotMultiDens

Plot Multiple Density Curves
PlotWeb

Plot a Web of Connected Points
PlotVenn

Plot a Venn Diagram
PlotCirc

Plot Circular Plot
SignTest

Sign Test
Rotate

Rotate a Geometric Structure
TheilU

Theil's U index of inequality
TextContrastColor

Choose Textcolor Depending on Background Color
WrdInsTab

Insert a Table in a Word Document
WrdInsertBookmark

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

Outlier
Untable

Untable
DrawRegPolygon

Draw Regular Polygon(s)
GCD, LCM

Greatest Common Divisor and Least Common Multiple
d.world

Some World Population and Geographic Data
WhichFlags

Get the Flags, Factors or Numerics of a data.frame
TukeyBiweight

Calculate Tukey's Biweight Robust Mean
FctArgs

Retrieve a Functions' Arguments
RgbToCol

Find the Named R-Color Which Is Nearest to a Given RGB-Color
PlotBubble

Draw a Bubble Plot
PercTable

Percentage Table
split.formula

Formula Interface for Split
Factorize

Prime Factorization of Integers
SampleTwins

Sample Twins
GoodmanKruskalGamma

Goodman Kruskal's Gamma
IsDate

Check if an Object is of Type Date
LOCF

Last Observation Carried Forward
PlotMarDens

Scatterplot with Marginal Densities
Sort

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

Determine All Possible Permutations of a Set
PasswordDlg

Password Dialog
PlotDesc

Display descriptive plots
Rev

Reverse Elements of a Vector or the Rows/Columns of Matrices and Tables
ShapiroFranciaTest

Shapiro-Francia test for normality
%like%

Like operator
StrChop

Split a String in a Number of Pieces With Fixed Length
Desc.formula

Describe Variables by Groups
KrippAlpha

Krippendorff's Alpha Reliability Coefficient
Winsorize

Winsorize
PtInPoly

Point in Polygon
StrAbbr

String Abbreviation
PalTibco

Some More Color Palettes
SpearmanRho

Spearman Rank Correlation
VarCI

Confidence Interval for the Variance
PairApply

Pairwise Calculations
RobRange

Robust Range
RelRisk

Relative Risk
Entropy

Shannon Entropy and Mutual Information
PlotHorizBar

Plot Horizontal Bars
StuartTauC

Stuart Tau C
PlotBag

PlotBag, a bivariate boxplot
Strata

Stratified sampling
IsPrime

IsPrime Property
PlotDotCI

Plot a Dotchart with Confidence Intervals
HexToCol

Identify closest match to a color given by a hexadecimal string
SpreadOut

Spread out a vector of numbers to a minimum interval
VecRot

Vector Rotation
Zodiac

Calculate the Zodiac of a Date
HoeffD

Matrix of Hoeffding's D Statistics
d.pizza

Data pizza
MHChisqTest

Mantel-Haenszel Chi-Square Test
XLGetWorkbook

Get the Values of All Sheets of an Excel Workbook
wdConst

Word VBA constants
%c%

Concatenates two strings without any separator.
UncertCoef

Uncertainty Coefficient
d.diamonds

Data diamonds
RobScale

Robust Scaling With Median and Mad
StrDist

Compute Distances Between Strings
WrdSetFont

Set the Font in Word
StrPad

StrPad a String With Justification
MeanSE

Standard error of mean
StrTrim

Trim a string
JarqueBeraTest

Jarque--Bera Test
identify.formula

Identify points in a plot using a formula.
LinScale

Perform a linear scaling of x
RunsTest

Runs Test for Randomness
Year

Part of Date
WrdR

Insert a R Command and It's Output in a Word Document
MedianCI

Confidence Interval for the Median
%overlaps%

Determines If And How Extensively Two Date Ranges Overlap
PlotArea

Create an Area Plot
PearsonTest

Pearson chi-square test for normality
PlotViolin

Plot Violins Instead of Boxplots
PlotPyramid

Draw a Back To Back Pyramid Plot
Recode

Recode a Factor
Rename

Change Names of a Named Object
Skew

Skewness and Kurtosis
XLView

Use Excel as Viewer for a Data.Frame
ZTest

Z Test for Known Population Standard Deviation
Assocs

Association Measures
ColorLegend

Add a ColorLegend to a Plot
DegToRad

Convert Degrees to Radians and vice versa
DrawBezier

Draw a Bezier Curve
Gini

Gini Coefficient
Herfindahl

Concentration Measures
Mround

Round to Multiple
PlotQQ

QQ-Plot for Optional Distributions
StrCap

Capitalize the First Letter of a String
Str

Compactly Display the Structure of an Arbitrary R Object
median.factor

Median for Ordered Factors
Desc.factor

Describe a factor, an ordered factor or a character vector
Desc.table

Describe a contingency table
GoodmanKruskalTauA

Goodman Kruskal's Tau a
InDots

Is a Specific Argument in the Dots-Arguments?
ICC

Intraclass Correlations (ICC1, ICC2, ICC3 from Shrout and Fleiss)
Lambda

Goodman Kruskal Lambda
PlotFaces

Chernoff Faces
WrdText

Insert Normal Text to Word