Learn R Programming

DescTools (version 0.99.6)

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, xname = NULL, maxlevels = 12, 
             digits = 3, plotit = FALSE, ...)

Arguments

x
a single integer vector to be described.
xname
the caption for the output.
maxlevels
integer. Until how many levels should the detailed frequencies be reported. Default is 12. If there are more levels, then the output will fallback to the presentation of highest and lowest values as used in for the representation of numeric variabl
digits
integer. With how many digits shoud the relative frequencies be formatted? Default is 3.
plotit
boolean. Should a plot be created? The vector would be plotted by means of PlotDesc.numeric, which again basically is PlotFdist. Default is FA
...
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 DataLab