DescTools0.99.56 package

Tools for Descriptive Statistics

WrdMergeCells

Merges Cells Of a Defined Word Table Range

IQRw

The (weighted) Interquartile Range

IsDate

Check If an Object Is of Type Date

WrdPageBreak

Insert a Page Break

WrdParagraphFormat

Get or Set the Paragraph Format in Word

CountCompCases

Count Complete Cases

Divisors

Calculate Divisors

DoBy

Evaluates a Function Groupwise

DoCall

Fast Alternative To The Internal do.call

ABCCoords

Coordinates for "bottomright", etc.

Abind

Combine Multidimensional Arrays

Abstract

Display Compact Abstract of a Data Frame

AddMonths

Add a Month to a Date

Agree

Raw Simple And Extended Percentage Agreement

AllDuplicated

Index Vector of All Values Involved in Ties

AllIdentical

Test Multiple Objects for Exact Equality

AndersonDarlingTest

Anderson-Darling Test of Goodness-of-Fit

Append

Append Elements to Objects

as.matrix

Convert xtabs To matrix

as.ym

A Class for Dealing with the Yearmonth Format

AscToChar

Convert ASCII Codes to Characters and Vice Versa

Asp

Get Aspect Ratio of the Current Plot

Assocs

Association Measures

Atkinson

Atkinson Index - A Measure of Inequality.

AUC

Area Under the Curve

AxisBreak

Place a Break Mark on an Axis

axTicks.POSIXct

Compute Axis Tickmark Locations (For POSIXct Axis)

BarnardTest

Barnard's Unconditional Test

BartelsRankTest

Bartels Rank Test of Randomness

BarText

Place Value Labels on a Barplot

BaseConversions

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

Benf

Benford's Distribution

Between

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

Bg

Background of a Plot

BootCI

Simple Bootstrap Confidence Intervals

BhapkarTest

Bhapkar Marginal Homogeneity Test

BinomCI

Confidence Intervals for Binomial Proportions

BinomCIn

Sample Size for a Given Width of a Binomial Confidence Interval

BinomDiffCI

Confidence Interval for a Difference of Binomials

BinomRatioCI.rd

Confidence Intervals for the Ratio of Binomial Proportions

BinTree

Binary Tree

CompleteColumns

Find Complete Columns

BoxCox

Box Cox Transformation

BoxCoxLambda

Automatic Selection of Box Cox Transformation Parameter

BoxedText

Add Text in a Box to a Plot

BreslowDayTest

Breslow-Day Test for Homogeneity of the Odds Ratios

BreuschGodfreyTest

Breusch-Godfrey Test

BrierScore

Brier Score for Assessing Prediction Accuracy

BrierScoreCI

Confidence Intervals for the BrierScore

BubbleLegend

Add a Legend to a Bubble Plot

Canvas

Canvas for Geometric Plotting

CartToPol

Transform Cartesian to Polar/Spherical Coordinates and Vice Versa

CatTable

Function to write a table

CCC

Concordance Correlation Coefficient

Clockwise

Calculates Begin and End Angle From a List of Given Angles in Clockwis...

Closest

Find the Closest Value

Coalesce

Return the First Element Not Being NA

CochranArmitageTest

Cochran-Armitage Test for Trend

CochranQTest

Cochran's Q test

CoefVar

Coefficient of Variation

CohenD

Cohen's Effect Size

CohenKappa

Cohen's Kappa and Weighted Kappa

CollapseTable

Collapse Levels of a Table

ColorLegend

Add a ColorLegend to a Plot

ColToGrey

Convert Colors to Grey/Grayscale

ColToHex

Convert a Color or a RGB-color Into Hex String

ColToHsv

R Color to HSV Conversion

ColToRgb

Color to RGB Conversion

ColumnWrap

Column Wrap

CombPairs

Get All Pairs Out of One or Two Sets of Elements

ConDisPairs

Concordant and Discordant Pairs

Conf

Confusion Matrix And Associated Statistics

ConnLines

Add Connection Lines to a Barplot

ConoverTest

Conover's Test of Multiple Comparisons

Contrasts

Pairwise Contrasts

ConvUnit

Unit Conversion and Metrix Prefixes

Cor

Covariance and Correlation (Matrices)

CorPart

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

CorPolychor

Polychoric Correlation

CountWorkDays

Count Work Days Between Two Dates

CourseData

Get HWZ Datasets

CramerV

Cramer's V, Pearson's Contingency Coefficient and Phi CoefficientYule'...

CramerVonMisesTest

Cramer-von Mises Test for Normality

CronbachAlpha

Cronbach's Coefficient Alpha

Cross

Vector Cross Product

CrossN

n-dimensional Vector Cross Product

Dot

Scalar Product

Cstat

C Statistic (Area Under the ROC Curve)

CstatCI

Confidence Intervals for the C Statistic (AUC)

CutAge

Create a Factor Variable by Cutting an Age Variable

CutQ

Create a Factor Variable Using the Quantiles of a Continuous Variable

EX

Expected Value and Variance

DatasetsforSimulation

Datasets for Probabilistic Simulation

DateFunctions

Basic Date Functions

DegToRad

Convert Degrees to Radians and Vice Versa

Desc

Describe Data

DescTools-package

Tools for Descriptive Statistics and Exploratory Data Analysis

DescToolsOptions

DescTools Options

DigitSum

Calculate Digit Sum

DivCoef

Rao's Diversity Coefficient

DivCoefMax

Maximal value of Rao's diversity coefficient also called quadratic ent...

DrawArc

Draw Elliptic Arc(s)

DrawBand

Draw Confidence Band

DrawBezier

Draw a Bezier Curve

DrawCircle

Draw a Circle

ExpFreq

Expected Frequencies

DrawEllipse

Draw an Ellipse

DrawRegPolygon

Draw Regular Polygon(s)

Dummy

Generate Dummy Codes for a Factor

DunnettTest

Dunnett's Test for Comparing Several Treatments With a Control

DunnTest

Dunn's Test of Multiple Comparisons

DurbinWatsonTest

Durbin-Watson Test

Entropy

Shannon Entropy and Mutual Information

Eps

Greenhouse-Geisser And Huynh-Feldt Epsilons

ErrBars

Add Error Bars to an Existing Plot

EtaSq

Effect Size Calculations for ANOVAs

Freq

Frequency Table for a Single Variable

ExtrVal

Distributions of Maxima and Minima

Factorize

Prime Factorization of Integers

FctArgs

Retrieve a Function's Arguments

Fibonacci

Fibonacci Numbers

FindColor

Get Color on a Defined Color Range

GeomSn

Geometric Series

FindCorr

Determine Highly Correlated Variables

FisherZ

Fisher-Transformation for Correlation to z-Score

FixToTable

Convert a Text to a Table

Format

Format Numbers and Dates

Frac

Fractional Part and Maximal Digits of a Numeric Value

Frechet

The Frechet Distribution

Freq2D

Bivariate (Two-Dimensional) Frequency Distribution

GCD

Greatest Common Divisor and Least Common Multiple

GenExtrVal

The Generalized Extreme Value Distribution

GenPareto

The Generalized Pareto Distribution

GenRandGroups

Generate Random Groups

GeomTrans

Geometric Transformations

GetCalls

Return All Used Functions Within a Function

GetCurrWrd

Get a Handle to a Running Word/Excel Instance

GetNewWrd

Create a New Word Instance

GetNewXL

Create a New Excel Instance

Gini

Gini Coefficient

GiniSimpson

Gini-Simpson Coefficient, Gini-Deltas coefficient and Hunter-Gaston In...

Gmean

Geometric Mean and Standard Deviation

Gompertz

The Gompertz distribution

GoodmanKruskalGamma

Goodman Kruskal's Gamma

GoodmanKruskalTau

Goodman Kruskal's Tau

GTest

G-Test for Count Data

Gumbel

The Gumbel Distribution

Herfindahl

Concentration Measures

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

Hmean

Harmonic Mean and Its Confidence Interval

HmsToSec

Convert h:m:s To/From Seconds

HodgesLehmann

Hodges-Lehmann Estimator of Location

HoeffD

Matrix of Hoeffding's D Statistics

InDots

Is a Specific Argument in the Dots-Arguments?

HosmerLemeshowTest

Hosmer-Lemeshow Goodness of Fit Tests

HotellingsT

Hotelling's T2 Test

HuberM

Safe (generalized) Huber M-Estimator of Location

ICC

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

identify.formula

Identify Points In a Plot Using a Formula

IdentifyA

Identify Points in Plot Lying Within a Rectangle or Polygon

IsDichotomous

Test If a Variable Contains Only Two Unique Values

IsEuclid

Is a Distance Matrix Euclidean?

IsOdd

Checks If An Integer Is Even Or Odd

IsPrime

IsPrime Property

IsValidHwnd

Check Windows Pointer

IsWhole

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

JarqueBeraTest

(Robust) Jarque Bera Test

JonckheereTerpstraTest

Exact Version of Jonckheere-Terpstra Test

KappaM

Kappa for m Raters

KendallTauA

Kendall's TauaTau-a

KendallTauB

Kendall's TaubTau-b

KendallW

Kendall's Coefficient of Concordance W

Keywords

List Keywords For R Manual Pages

KnnImputation

Fill in NA values with the values of the nearest neighbours

KrippAlpha

Krippendorff's Alpha Reliability Coefficient

Label

Label, Unit Attribute of an Object

Lambda

Goodman Kruskal Lambda

Large

Kth Smallest/Largest Values

Lc

Lorenz Curve

MedianCI

Confidence Interval for the Median

LehmacherTest

Lehmacher's Test for Marginal Homogenity

LeveneTest

Levene's Test for Homogeneity of Variance

like

Like Operator

LillieTest

Lilliefors (Kolmogorov-Smirnov) Test for Normality

lines.lm

Add a Linear Regression Line

lines.loess

Add a Loess or a Spline Smoother

LineToUser

Convert Line Coordinates To User Coordinates

Mgsub

Multiple Gsub

LinScale

Linear Scaling

LOCF

Last Observation Carried Forward

LOF

Local Outlier Factor

Logit

Generalized Logit and Inverse Logit Function

LogSt

Started Logarithmic Transformation and Its Inverse

LsFct

List Objects, Functions Or Data in a Package

MAD

Median Absolute Deviation

MADCI

Confidence Intervals for Median Absolute Deviations

MAE

Measures of Accuracy

Mar

Set Plot Margins and Distances

matpow

Matrix Power

ORToRelRisk

Transform Odds Ratio to Relative Risk

Mean

(Weighted) Arithmetic Mean

MeanAD

Mean Absolute Deviation From a Center Point

MeanCI

Confidence Intervals for the Mean

MeanCIn

Sample Size for a Given Width of a Confidence Interval for a Mean

MeanDiffCI

Confidence Interval For Difference of Means

MeanSE

Standard Error of Mean

Median

(Weighted) Median Value

Recycle

Recyle a List of Elements

MHChisqTest

Mantel-Haenszel Chi-Square Test

Midx

Find the Midpoints of a Numeric Vector

MixColor

Compute the Convex Combination of Two Colors

Mode

Mode, Most Frequent Value(s)

MosesTest

Moses Test of Extreme Reactions

MoveAvg

Moving Average

MultinomCI

Confidence Intervals for Multinomial Proportions

Order

Distributions of Order Statistics

MultMerge

Merge Multiple Data Frames

n

Some Aliases Set for Convenience

NALevel

Replace NAs in a Factor by a Given Level

NemenyiTest

Nemenyi Test

Nf

As Numeric Factor

nin

Find Matching (or Non-Matching) Elements

NPV

Short Selection of Financial Mathematical Functions

NZ

Non Zero Elements

OddsRatio

Odds Ratio Estimation and Confidence Intervals

Outlier

Outlier

overlaps

Determines If And How Extensively Two Date Ranges Overlap

PageTest

Exact Page Test for Ordered Alternatives

PairApply

Pairwise Calculations

Pal

Some Custom Palettes

RelRisk

Relative Risk

ParseFormula

Parse a Formula and Create a Model Frame

ParseSASDatalines

Parse a SAS Dataline Command

PasswordDlg

Password Dialog

paste

Concatenates Two Strings Without Any Separator

PDFManual

Get PDF Manual of a Package From CRAN

PearsonTest

Pearson Chi-Square Test for Normality

PercentRank

Percent Ranks

PercTable

Percentage Table

Permn

Number and Samples for Permutations or Combinations of a Set

Phrase

Phrasing Results of t-Test

PlotACF

Combined Plot of a Time Series and Its ACF and PACF

PlotArea

Create an Area Plot

PlotBag

Bivariate Boxplot

PlotBubble

Draw a Bubble Plot

PlotCandlestick

Plot Candlestick Chart

PlotCashFlow

Cash Flow Plot

PlotCirc

Plot Circular Plot

PlotConDens

Plot Conditional Densities

PlotCorr

Plot a Correlation Matrix

PlotDot

Cleveland's Dot Plots

PlotECDF

Empirical Cumulative Distribution Function

PlotFaces

Chernoff Faces

PlotFdist

Frequency Distribution Plot

PlotFun

Plot a Function

PlotLinesA

Plot Lines

PlotLog

Logarithmic Plot

PlotMarDens

Scatterplot With Marginal Densities

PlotMiss

Plot Missing Data

PlotMonth

Cycle Plot for Seasonal Effects of an Univariate Time Series

PlotMosaic

Mosaic Plots

PlotMultiDens

Plot Multiple Density Curves

PlotPairs

Extended Scatterplot Matrices

PlotPolar

Plot Values on a Circular Grid

PlotProbDist

Plot Probability Distribution

PlotPyramid

Draw a Back To Back Pyramid Plot

PlotQQ

QQ-Plot for Any Distribution

PlotTernary

Ternary or Triangular Plots

PlotTreemap

Create a Treemap

PlotVenn

Plot a Venn Diagram

PlotViolin

Plot Violins Instead of Boxplots

PlotWeb

Plot a Web of Connected Points

PMT

Periodic Payment of an Annuity.

PoissonCI

Poisson Confidence Interval

PolarGrid

Plot a Grid in Polar Coordinates

PostHocTest

Post-Hoc Tests

power.chisq.test

Power Calculations for ChiSquared Tests

PpPlot

Add Slides, Insert Texts and Plots to PowerPoint

Primes

Find All Primes Less Than n

PseudoR2

Pseudo R2 Statistics

PtInPoly

Point in Polygon

Quantile

(Weighted) Sample Quantiles

QuantileCI

Confidence Interval for Any Quantile

Quot

Lagged Quotients

Range

(Robust) Range

Rank

Fast Sample Ranks

Recode

Recode a Factor

Rename

Change Names of a Named Object

ReorderFactor

Reorder the Levels of a Factor

Rev

Reverse Elements of a Vector, a Matrix, a Table, an Array or a Data.fr...

RevCode

Reverse Codes

StripAttr

Remove Attributes from an Object

RevGumbel

"Reverse" Gumbel Distribution Functions

RevWeibull

The Reverse Weibull Distribution

RgbOpaque

Equivalent Opaque Color for Transparent Color

RgbToCmy

Conversion Between RGB and CMYK

RgbToCol

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

StrIsNumeric

Does a String Contain Only Numeric Data

RndPairs

Create Pairs of Correlated Random Numbers

RobScale

Robust Scaling With Median and Mad

RomanToInt

Convert Roman Numerals to Integers

Rotate

Rotate a Geometric Structure

RoundTo

Round to Multiple

RSessionAlive

How Long Has the RSession Been Running?

RSqCI

Confidence Intervals for the R squared of a Linear Model

rSum21

Random Numbers Adding Up to 1

RunsTest

Runs Test for Randomness

Sample

Random Samples and Permutations

SampleTwins

Sample Twins

SaveAs

Saves an R Object Under a Different Name

ScheffeTest

Scheffe Test for Pairwise and Otherwise Comparisons

WithOptions

Execute Function with Temporary Options

SD

(Weighted) Standard Deviation

SendOutlookMail

Send a Mail Using Outlook as Mail Client

SetAlpha

Add an Alpha Channel To a Color

SetNames

Set the Names in an Object

Shade

Produce a Shaded Curve

ShapiroFranciaTest

Shapiro-Francia Test for Normality

SiegelTukeyTest

Siegel-Tukey Test For Equality In Variability

SignTest

Sign Test

Skew

Skewness and Kurtosis

SLN

Several Methods of Depreciation of an Asset

SmoothSpline

Formula Interface For smooth.spline

Some

Return Some Randomly Chosen Elements of an Object

SomersDelta

Somers' Delta

Sort

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

SortMixed

Sort Strings with Embedded Numbers Based on Their Numeric Order

SpearmanRho

Spearman Rank Correlation

split.formula

Formula Interface for Split

SplitAt

Split a Vector Into Several Pieces at Given Positions

SplitPath

Split Path In Drive, Path, Filename

SplitToCol

Split Data Frame String Column Into Multiple Columns

SplitToDummy

Split Strings of a Vector and Provide Dummy Codes for Found Pieces

SpreadOut

Spread Out a Vector of Numbers To a Minimum Interval

Stamp

Date/Time/Directory Stamp the Current Plot

StdCoef

Standardized Model Coefficients

Str

Compactly Display the Structure of any R Object

StrAbbr

String Abbreviation

StrAlign

String Alignment

Strata

Stratified Sampling

StrCap

Capitalize the First Letter of a String

StrChop

Split a String into a Number of Sections of Defined Length

StrCountW

Count Words in a String

StrDist

Compute Distances Between Strings

StrExtract

Extract Part of a String

StrPad

Pad a String With Justification

StrPos

Find Position of First Occurrence Of a String

StrRev

Reverse a String

StrRight

Returns the Left Or the Right Part Of a String

StrSpell

Spell a String Using the NATO Phonetic or the Morse Alphabet

StrSplit

Split the Elements of a Character Vector

StrTrim

Remove Leading/Trailing Whitespace From A String

StrTrunc

Truncate Strings and Add Ellipses If a String is Truncated.

StrVal

Extract All Numeric Values From a String

StuartMaxwellTest

Stuart-Maxwell Marginal Homogeneity Test

StuartTauC

Stuart TaucTau-c

SysInfo

System Information

TextContrastColor

Choose Textcolor Depending on Background Color

TextToTable

Converts String To a Table

TheilU

Theil's U Index of Inequality

TitleRect

Plot Boxed Annotation

TMod

Comparison Table For Linear Models

TOne

Create Table One Describing Baseline Characteristics

WrdFormatCells

Format Cells Of a Word Table

ToWide

Reshape a Vector From Long to Wide Shape Or Vice Versa

ToWrd

Send Objects to Word

ToWrdB

Send Objects to Word and Bookmark Them

ToWrdPlot

Send a Plot to Word and Bookmark it

Triangular

The Triangular Distribution

Trim

Trim a Vector

TTestA

Student's t-Test Based on Sample Statistics

TukeyBiweight

Calculate Tukey's Biweight Robust Mean

TwoGroups

Describe a Variable by a Factor with Two Levels

UncertCoef

Uncertainty Coefficient

UnirootAll

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

Untable

Recover Original Data From Contingency Table

Unwhich

Inverse Which

VanWaerdenTest

van der Waerden Test

Var

Variance

VarCI

Confidence Intervals for the Variance

VarTest

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

VecRot

Vector Rotation (Shift Elements)

VIF

Variance Inflation Factors

Vigenere

Vigenere Cypher

VonNeumannTest

Von Neumann's Successive Difference Test

Winsorize

Winsorize (Replace Extreme Values by Less Extreme Ones)

WoolfTest

Woolf Test For Homogeneity in 2x2xk Tables

WrdBookmark

Some Functions to Handle MS-Word Bookmarks

WrdCaption

Insert Caption to Word

WrdCellRange

Return the Cell Range Of a Word Table

WrdFont

Get or Set the Font in Word

WrdPlot

Insert Active Plot to Word

WrdSaveAs

Open and Save Word Documents

WrdStyle

Get or Set the Style in Word

WrdTable

Insert a Table in a Word Document

WrdTableBorders

Draw Borders to a Word Table

WrdTableHeading

Insert Headings for a Table in Word

XLDateToPOSIXct

Convert Excel Dates to POSIXct

XLGetRange

Import Data Directly From Excel

XLSaveAs

Save Excel File

XLView

Use MS-Excel as Viewer for a Data.Frame

YuenTTest

Yuen t-Test For Trimmed Means

ZeroIfNA

Replace NAs by 0

Zodiac

Calculate the Zodiac of a Date

ZTest

Z Test for Known Population Standard Deviation

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 'BigCamelCase' style was consequently applied to functions borrowed from contributed R packages as well.

  • Maintainer: Andri Signorell
  • License: GPL (>= 2)
  • Last published: 2024-08-22