Learn R Programming

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

DescTools (version 0.99.17)

Tools for Descriptive Statistics

Description

A collection of miscellaneous basic statistic functions and convenience wrappers for efficiently describing data. The author's intention was to create 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. The package contains furthermore functions to produce documents using MS Word (or PowerPoint) and functions to import data from Excel. 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.17

License

GPL (>= 2)

Maintainer

Andri Signorell

Last Published

June 15th, 2016

Functions in DescTools (0.99.17)

Atkinson

Calculate the Atkinson Index
BoxCox

Box Cox Transformation
AllDuplicated

Index Vector of All Values Involved in Ties
BinomCI

Confidence Intervals for Binomial Proportions
BinomDiffCI

Confidence Interval for a Difference of Binomials
AxisBreak

Place a Break Mark on an Axis
BoxCoxLambda

Automatic Selection of Box Cox Transformation Parameter
BartelsRankTest

Bartels Rank Test
BoxedText

Add Text in a Box to a Plot
BreslowDayTest

Breslow-Day Test for Homogeneity of the Odds Ratios
Benford

Benford's Distribution
BreuschGodfreyTest

Breusch-Godfrey Test
Between, Outside

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

Add a Legend to a Bubble Plot
Cor

Correlation, Variance and Covariance (Matrices)
ClipToVect

Reformat a Table in the Clipboard as Vector
CorPart

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

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

Convert a Color into Hex String
CombPairs

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

Create a Date from Numeric Representation
DoCall

Fast Alternative To The Internal do.call
DivCoefMax

Maximal value of Rao's diversity coefficient also called quadratic entropy
Datasets for Simulation

Datasets for Probabilistic Simulation
d.pizza

Data pizza
d.whisky

Classification of Scotch Single Malts
DrawRegPolygon

Draw Regular Polygon(s)
DrawBezier

Draw a Bezier Curve
d.diamonds

Data diamonds
d.periodic

Periodic Table of Elements
CohenD

Cohen's Effect Size
DunnettTest

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

Collapse Levels of a Table
DunnTest

Dunn's Test of Multiple Comparisons
CutQ

Create a Factor Variable Using the Quantiles of a Continuous Variable
d.countries

ISO 3166-1 Country Codes
Date Functions

Basic Date Functions
day.name

Build-in Constants Extension
DrawAnnulus

Draw One or Several Annuli
DrawAnnulusSector

Draw a Sector of an Annulus
Canvas

Canvas for Geometric Plotting
FindCorr

Determine highly correlated variables
CatTable

Function to write a table
Freq

Frequency Table
ColorLegend

Add a ColorLegend to a Plot
DrawArc

Draw Elliptic or Circular Arc(s)
ColToGrey

Convert Colors to Grey/Grayscale
DrawBand

Draw Confidence Band
Exec

Execute a Command Given As String
EtaSq

Effect size calculations for ANOVAs
ErrBars

Add Error Bars to an Existing Plot
Factorize

Prime Factorization of Integers
Coalesce

Return the First Element Not Being NA
CochranQTest

Cochran's Q test
Agree

Raw Simple And Extended Percentage Agreement
ConDisPairs

Concordant and Discordant Pairs
ConnLines

Add Connection Lines to a Barplot
Desc

Describe Data
DivCoef

Rao's diversity coefficient also called quadratic entropy
GetNewPP

Create a new PowerPoint Instance
GCD, LCM

Greatest Common Divisor and Least Common Multiple
Hmean

Harmonic mean
HighLow

Return the Lowest and the Highest Values and Their Frequencies
identify.formula

Identify Points In a Plot Using a Formula.
ImportFileDlg

Import File In Foreign Format
InDots

Is a Specific Argument in the Dots-Arguments?
LeveneTest

Levene's Test for Homogeneity of Variance
lines.loess

Add a Loess or a Spline Smoother
Mean

Arithmetic Mean
PageTest

Exact Page Test for Ordered Alternatives
MeanAD

Mean Absolute Deviation From a Center Point
AddMonthsYM

Add a Month to a Date
Fibonacci

Fibonacci Numbers
AddMonths

Add a Month to a Date
FindColor

Get Color on a Defined Color Range
GiniSimpson

Compute Gini-Simpson Coefficient
GTest

G-Test for Count Data
HmsToSec

Convert h:m:s To/From Seconds
HoeffD

Matrix of Hoeffding's D Statistics
Some numeric checks

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

Log Linear Hybrid, Generalized Log
JarqueBeraTest

(Robust) Jarque Bera Test
Logit

Generalized Logit and Inverse Logit function
MHChisqTest

Mantel-Haenszel Chi-Square Test
MedianCI

Confidence Interval for the Median
PlotFaces

Chernoff Faces
PlotFdist

Frequency Distribution Plot
PlotMultiDens

Plot Multiple Density Curves
PlotPolar

Plot Values on a Circular Grid
as.matrix.xtabs

Convert xtabs To matrix
AndersonDarlingTest

Anderson-Darling Test of Goodness-of-Fit
Eps

Greenhouse-Geisser And Huynh-Feldt Epsilons
DurbinWatsonTest

Durbin-Watson Test
HexToCol

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

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

Hotelling's T2 Test
HuberM

Safe (generalized) Huber M-Estimator of Location
Keywords

List Keywords For R Manual Pages
MeanDiffCI

Confidence Interval For Difference of Means
MeanCI

Confidence Interval for the Mean
ImportDlg

Get Path of a Data File to Be Opened
median.factor

Median for Ordered Factors
Median

Median Value
PDFManual

Get PDF Manual Of a Package From CRAN
PearsonTest

Pearson chi-square test for normality
PlotFun

Plot a Function
PlotHorizBar

Plot Horizontal Bars
PlotPyramid

Draw a Back To Back Pyramid Plot
IsEuclid

Is a Distance Matrix Euclidean?
IsDate

Check if an Object is of Type Date
AscToChar

Convert ASCII Codes to Characters and Vice Versa
IsPrime

IsPrime Property
IsValidWrd

Check Word Pointer
LsFct

List Functions of a Package
Mar

Set Plot Margins
NemenyiTest

Nemenyi Test
MultinomCI

Confidence Intervals for Multinomial Proportions
ParseSASDatalines

Parse a SAS Dataline Command
%c%

Concatenates two strings without any separator.
reorder.factor

Reorder the Levels of a Factor
Rev

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

Shapiro-Francia test for normality
SiegelTukeyTest

Siegel-Tukey Test For Equality In Variability
Label

Label Attribute of an Object
LOF

Local Outlier Factor
LinScale

Perform a linear scaling of x
MosesTest

Moses Test of Extreme Reactions
MoveAvg

Moving Average
%nin%

Find Matching (or Non-Matching) Elements
PlotQQ

QQ-Plot for Any Distribution
ORToRelRisk

Transform Odds Ratio to Relative Risk
PolarGrid

Plot a Grid in Polar Coordinates
power.chisq.test

Power Calculations for ChiSquared Tests
RomanToInt

Convert Roman Numerals to Integers
SD

Standard Deviation
SampleTwins

Sample Twins
SelectVarDlg

Select Elements of a Set by Click
StrRev

Reverse a String
Strata

Stratified sampling
StrCap

Capitalize the First Letter of a String
VarCI

Confidence Interval for the Variance
VarTest

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

Insert Caption to Word
WrdFont

Get or Set the Font in Word
PlotLinesA

Plot Lines
PlotMarDens

Scatterplot with Marginal Densities
ColPicker

Information plots
StrTrim

Remove Leading/Trailing Whitespace From A String
PlotTernary

Ternary or Triangular Plots.
TextContrastColor

Choose Textcolor Depending on Background Color
TheilU

Theil's U index of inequality
WoolfTest

Woolf Test
WrdStyle

Get or Set the Style in Word
Winsorize

Winsorize
XLGetRange

Import Data Directly From Excel
Range

Range
PtInPoly

Point in Polygon
pRevGumbel

"Reverse" Gumbel Distribution Functions
Stamp

Date/Time/Directory Stamp the Current Plot
RgbToCol

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

Compactly Display the Structure of an Arbitrary R Object
StuartMaxwellTest

Stuart-Maxwell Marginal Homogeneity Test
SysInfo

System Information And DescTools Options
VecRot

Vector Rotation
wdConst

Word VBA constants
Primes

Find all Primes Less Than n
PpPlot

Add Slides, Insert Texts and Plots to PowerPoint
ScheffeTest

Scheffe Test for Pairwise and Otherwise Comparisons
SaveAsDlg

Save R Objects By Choosing a File Interactively
SortMixed

Order or Sort Strings With Embedded Numbers So That The Numbers Are In The Correct Order
split.formula

Formula Interface for Split
TukeyBiweight

Calculate Tukey's Biweight Robust Mean
Untable

Recover Original Data From Contingency Table
SetAlpha

Add an Alpha Channel To a Color
AddClass

Add and Remove Classes From an Object
GetNewXL

Create a new Excel Instance
Extremes

Kth Smallest/Largest Values
Gini

Gini Coefficient
MixColor

Compute the convex combination of two colors
Mode

Mode
Lc

Lorenz Curve
PlotACF

Combined Plot of a Time Series and its ACF and PACF
PlotBag

PlotBag, a bivariate boxplot
WrdInsertBookmark

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

Get or Set the Paragraph Format in Word
XLView

Use Excel as Viewer for a Data.Frame
PlotCirc

Plot Circular Plot
Xplore

Interactive Graphical Data Explorer
PlotDot

Cleveland's Dot Plots
PlotMatrix

Scatterplot Matrix
PlotMonth

Plot Monthly or Seasonal Effects Of a Univariate Time Series
PlotWeb

Plot a Web of Connected Points
PoissonCI

Poisson Confidence Interval
ParseFormula

Parse a Formula and Create a Model Frame
PlotBubble

Draw a Bubble Plot
PlotCandlestick

Plot Candlestick Chart
Recode

Recode a Factor
PlotViolin

Plot Violins Instead of Boxplots
PlotVenn

Plot a Venn Diagram
Rename

Change Names of a Named Object
SmoothSpline

Formula Interface For smooth.spline
Sort

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

Split Path In Drive, Path, Filename
RobRange

Robust Range
SignTest

Sign Test
RobScale

Robust Scaling With Median and Mad
StrDist

Compute Distances Between Strings
Measures of Shape

Skewness and Kurtosis
StrTrunc

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

Pad a String With Justification
StrVal

Extract All Numeric Values From a String
WrdPlot

Insert Active Plot to Word
WrdR

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

Spread Out a Vector of Numbers To a Minimum Interval
YuenTTest

Yuen t-Test For Trimmed Means
ZTest

Z Test for Known Population Standard Deviation
Zodiac

Calculate the Zodiac of a Date