Learn R Programming

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

DescTools (version 0.99.6)

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

License

GPL (>= 2)

Maintainer

Andri Signorell

Last Published

January 7th, 2014

Functions in DescTools (0.99.6)

HighLow

Return the Lowest and the Highest Values and Their Frequencies
AddLm

Add a Linear Regression Line
BoxCoxLambda

Automatic selection of Box Cox transformation parameter
Desc.data.frame

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

Association Measures
AddConnLines

Add Connection Lines to a Barplot
CramerVonMisesTest

Cramer-von Mises test for normality
AddLoess

Add a Loess Smoother
Between

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

Area Under the Curve
CohenKappa

Cohen's Kappa and Weighted Kappa
BoxCox

Box Cox Transformation
CochranArmitageTest

Cochran-Armitage test for trend
AddErrBars

Add Error Bars to an Existing Plot
CochranQTest

Cochran's Q test
Desc.numeric

Describe a numeric vector
CramerV

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

Converts ASCII Codes to Characters and Vice Versa
AddMonths

Add a Month to a Date
ClipToVect

Reformat a Table in the Clipboard as Vector
Atkinson

Calculate the Atkinson Index
BinToDec

Converts numbers from binmode, octmode or hexmode to decimal and vice versa
BoxedText

Add Text in a Box to a Plot
AreaIdent

Identify Points in Plot Defined by an Upper-Left and a Bottom-Right Click
ColToGrey

Convert Colors to Grey/Grayscale
CutQ

Build Quantile Groups for a Numeric Variable
DrawRegPolygon

Draw Regular Polygon(s)
ChooseColorDlg

Display Color Dialog to Choose a Color
SetAlpha

Add an Alpha Channel To a Color
DivCoef

Rao's diversity coefficient also called quadratic entropy
BinomCI

Confidence Intervals for Binomial Proportions
DrawEllipse

Draw an Ellipse
DescTools-internal

Internal DescTools objects
CartToPol

Transform Cartesian to Polar Coordinates and vice versa
Canvas

Canvas for Geometric Plotting
CatTable

Function to write a table
ColToHex

Convert a Color into Hex String
AndersonDarlingTest

Anderson-Darling test for normality
ColToRgb

Color to RGB Conversion
ColorLegend

Add a ColorLegend to a Plot
DescTools-package

Tools for Efficient Descriptive Statistics
BreslowDayTest

Breslow-Day Test for Homogeneity of the Odds Ratios
Desc.Date

Describe a Date Vector
Desc.factor

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

Describe a contingency table
DrawCircle

Draw a Circle
DegToRad

Convert Degrees to Radians and vice versa
InDots

Is a Specific Argument in the Dots-Arguments?
LsFct

List Functions of a Package
AllDuplicated

Index Vector of All Values Involved in Ties
AxisBreak

Place a Break Mark on an Axis
PercTable

Percentage Table
Entropy

Shannon Entropy and Mutual Information
Coalesce

Return the First Element Not Being NA
FctArgs

Retrieve a Functions' Arguments
ColToHsv

R Color to HSV Conversion
DrawBand

Draw Confidence Band
Date

Create a Date from Numeric Representation
CronbachAlpha

Cronbach's Coefficient Alpha
GoodmanKruskalGamma

Goodman Kruskal's Gamma
Dummy

Generate Dummy Codes for a Factor
JonckheereTerpstraTest

Exact Version of Jonckheere-Terpstra Test
Gini

Gini Coefficient
ExpFreq

Expected frequencies
DivCoefMax

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

Display descriptive plots
DrawBezier

Draw a Bezier Curve
GetNewXL

Create a new Excel Instance
Desc

Describe Data
Desc.integer

Describe an integer variable
HexToRgb

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

Compute Gini-Simpson Coefficient
PlotMarDens

Scatterplot with Marginal Densities
Hmean

Harmonic mean
GetAllSubsets

Get All Subsets out of a List of Elements
Desc.formula

Describe Variables by Groups
GetCurrWrd

Get a Handle to a Running Word Instance
GetPairs

Get All Pairs out of one or two Sets of Elements
Desc.logical

Describe a dichotomous variable
GetNewWrd

Create a new Word Instance
Gmean

Geometric Mean and Standard Deviation
ConDisPairs

Concordant and Discordant Pairs
Logit

Generalized Logit and Inverse Logit function
HoeffD

Matrix of Hoeffding's D Statistics
IsValidWrd

Check Word Pointer
IsPrime

IsPrime Property
Mround

Round to Multiple
DescWrd

Use Word as Reporting Tool for Describing Data
Rename

Change Names of a Named Object
Primes

Find all Primes Less Than n
ShapiroFranciaTest

Shapiro-Francia test for normality
HuberM

Safe (generalized) Huber M-Estimator of Location
KendallTauB

Kendall tau-b
PlotFdist

Frequency Distribution Plot
Mbind

Bind k nxm-matrices with the same dimension
PlotCorr

Plot a Correlation Matrix
Lambda

Goodman Kruskal Lambda
Fibonacci

Fibonacci Series
d.pizza

Data pizza
FixToTab

Text to Table
Freq

Frequency Table
Midx

Find the Midpoints of a Numeric Vector
FormatFix

Format to a fixed format representation
DrawAnnulusSector

Draw a Sector of an Annulus
GetNewPP

Create a new PowerPoint Instance
Clockwise

Calculates Begin and End Angle From a List of Given Angles in Clockwise Mode
GCD, LCM

Greatest Common Divisor and Least Common Multiple
DrawAnnulus

Draw One or Several Annuli
PlotTreemap

Create a Treemap
StrCap

Capitalize the First Letter of a String
GoodmanKruskalTauA

Goodman Kruskal's Tau a
RelRisk

Relative Risk
StrChop

Split a String in a Number of Pieces With Fixed Length
Kappam

Kappa for m raters
FindColor

Get Color on a Defined Color Range
SiegelTukeyTest

Siegel-Tukey Test for equality in variability
Herfindahl

Concentration Measures
MHChisqTest

Mantel-Haenszel Chi-Square Test
StuartTauC

Stuart Tau C
ICC

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

Get Path of a Data File to Be Opened
IsWhole

Is x a Whole Number?
FisherZ

Fisher r to z and z to r and confidence intervals
MultinomCI

Confidence Intervals for Multinomial Proportions
HexToCol

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

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

Label Attribute of an Object
identify.formula

Identify points in a plot using a formula.
MosesTest

Moses Test of Extreme Reactions
LOCF

Last Observation Carried Forward
PpPlot

Add Slides, Insert Texts and Plots to PowerPoint
PlotCirc

Plot Circular Plot
PlotMatrix

Scatterplot Matrix
MeanCI

Confidence Interval for the Mean
WhichFlags

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

Runs Test for Randomness
LeveneTest

Levene's Test for Homogeneity of Variance
PearsonTest

Pearson chi-square test for normality
VarCI

Confidence Interval for the Variance
ParseFormula

Parse a Formula and Create a Model Frame
PlotHorizBar

Plot Horizontal Bars
MeanAD

Mean Absolute Deviation From a Center Point
VecRot

Vector Rotation
XLView

Use Excel as Viewer for a Data.Frame
TukeyBiweight

Calculate Tukey's Biweight Robust Mean
Sort

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

Spread out a vector of numbers to a minimum interval
Permn

Determine All Possible Permutations of a Set
IsDate

Check if an Object is of Type Date
RobRange

Robust Range
PalTibco

Some More Color Palettes
Mode

Mode
JarqueBeraTest

Jarque--Bera Test
MedianCI

Confidence Interval for the Median
Str

Compactly Display the Structure of an Arbitrary R Object
PlotBag

PlotBag, a bivariate boxplot
DrawArc

Draw Elliptic or Circular Arc(s)
Frac

Return the Fractional Part of a Numeric Value
Factorize

Prime Factorization of Integers
PlotWeb

Plot a Web of Connected Points
RobScale

Robust Scaling With Median and Mad
OddsRatio

Odds Ratio Estimation and Confidence Intervals
StrTrunc

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

Woolf Test
PlotDotCI

Plot a Dotchart with Confidence Intervals
%overlaps%

Determines If And How Extensively Two Date Ranges Overlap
PlotViolin

Plot Violins Instead of Boxplots
Ndec

Count Decimal Places of a Number
StrRev

Reverse a String
MeanDiffCI

Confidence Intervals for Difference of Means
Ray

Compact Information About the Columns of a Data Frame
SomersDelta

Somers' Delta
PlotArea

Create an Area Plot
PlotRCol

Information plots
PlotMonth

Plot Monthly or Seasonal Effects Of a Univariate Time Series
PlotPyramid

Draw a Back To Back Pyramid Plot
PlotBubble

Draw a Bubble Plot
PairApply

Pairwise Calculations
Recode

Recode a Factor
StrCountW

Count Words in a String
StrDist

Compute Distances Between Strings
IsEuclid

Is a Distance Matrix Euclidean?
SpearmanRho

Spearman Rank Correlation
%like%

Like operator
SelectVarDlg

Select Elements of a Set by Click
Skew

Skewness and Kurtosis
PlotACF

Combined Plot of a Time Series and it's Autocorrelation and Partial Autocorrelation
SignTest

Sign Test
WrdInsertBookmark

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

Plot Values on a Circular Grid
RgbToCol

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

Plot a Grid in Polar Coordinates
PlotCandlestick

Plot Candlestick Chart
WrdTable

Produces a Table in Word
LillieTest

Lilliefors (Kolmogorov-Smirnov) test for normality
Zodiac

Calculate the Zodiac of a Date
day.name

Build-in Constants Extension
PlotDotCIp

Plot a Dotchart with Binomial Confidence Intervals
Strata

Stratified sampling
XLGetRange

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

Rotate a Geometric Structure
Lc

Lorenz Curve
TheilU

Theil's U index of inequality
TextContrastColor

Choose Textcolor Depending on Background Color
WrdSetFont

Set the Font in Word
PageTest

Exact Page Test for Ordered Alternatives
PlotMultiDens

Plot Multiple Density Curves
PlotFaces

Chernoff Faces
WrdCaption

Insert Caption to Word
WrdText

Insert Normal Text to Word
Year

Part of Date
XLGetWorkbook

Get the Values of All Sheets of an Excel Workbook
d.world

Some World Population and Geographic Data
WrdPlot

Insert Active Plot to Word
StrPad

StrPad a String With Justification
StrTrim

Trim a string
%nin%

Find Matching (or Non-Matching) Elements
d.diamonds

Data diamonds
wdConst

Word VBA constants
WrdR

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

Started Logarithmic Transformation and It's Inverse
Winsorize

Winsorize
UncertCoef

Uncertainty Coefficient
FormatSig

Significance Representation of a P-Value
LogLin

Log Linear Hybrid, Generalized Log
MeanSE

Standard error of mean
LinScale

Perform a linear scaling of x
Partial

Find the Partial Correlations for a Set x of Variables With Set y Removed.
PoissonCI

Poisson Confidence Interval
PlotVenn

Plot a Venn Diagram
Untable

Untable
ZTest

Z Test for Known Population Standard Deviation
median.factor

Median for Ordered Factors
%c%

Concatenates two strings without any separator.