DescTools (version 0.99.13)

Desc.integer: Describe an integer variable

Description

Describing an integer, means typically count data, is sometimes the same as describing an ordered factor, and somethimes, when there are many levels, it is like describing a numeric value.

Usage

## S3 method for class 'integer':
Desc(x, main = NULL, maxrows = 12, freq = NULL,
             digits = NULL, plotit = getOption("plotit", FALSE), ...)

Arguments

x
a single integer vector to be described.
main
the caption for the output.
maxrows
integer. This indicates, up to how many levels the detailed frequencies should be reported. Default is 12. Set maxlevels to NA, if no restriction is to be applied, say the frequency table should contain all existing levels.
freq
logical, indicating if a frequency table should be plotted. Default is NULL, which means a frequency table will be printed, if there are less than 13 unique values. Else there will be a high-low description produced by HighLow.
digits
integer. With how many digits shoud the relative frequencies be formatted? Default is 2.
plotit
boolean. Should a plot be created? The vector would be plotted by means of PlotDesc.numeric, which again basically is PlotFdist. Default is FAL
...
further argument to be passed to methods.

Value

  • A list containing the following components:
  • lengththe length of the vector (n + NAs).
  • nthe valid entries (NAs are excluded)
  • NAsnumber of NAs
  • uniquenumber of unique values.
  • 0snumber of zeros
  • meanarithmetic mean
  • MeanSEstandard error of the mean, as calculated by MeanSE.
  • quanta table of quantiles, as calculated by quantile(x, probs = c(.05,.10,.25,.5,.75,.9,.95), na.rm = TRUE).
  • sdstandard deviation
  • vcoefcoefficient of variation: mean(x) / sd(x)
  • madmedian absolute deviation (mad)
  • IQRinterquartile range
  • skewskewness, as calculated by Skew.
  • kurtkurtosis, as calculated by Kurt.
  • highlowthe lowest and the highest values, reported with their frequencies in brackets, if > 1.
  • frqa data.frame of absolute and relative frequencies given by Freq if maxlevels > unique values in the vector.

Details

A horizontal barplot would be suitable as well here.

See Also

Desc.factor

Examples

Run this code
# default
Desc(d.pizza$count)

# with frequency table
Desc(d.pizza$count, maxlevels=15)

# Result object
res <- Desc(d.pizza$count, maxlevels=15)
res

Run the code above in your browser using DataCamp Workspace