Calculates mean, standard deviation, min, max, median, mad, IQR*, CV, skewness*, SE.skewness*, and kurtosis* on numerical vectors. (*) Not available when using sample weights.
descr(x, stats = "all", na.rm = TRUE, round.digits = 2,
transpose = FALSE, style = "simple", plain.ascii = TRUE,
justify = "right", omit.headings = FALSE, use.labels = FALSE,
display.labels = TRUE, weights = NA, rescale.weights = FALSE, ...)A numerical vector or a data frame.
Which stats to produce. Either “all” (default), or a selection of : “mean”, “sd”, “min”, “med”, “max”, “mad”, “iqr”, “cv”, “skewness”, “se.skewness”, “kurtosis”, “n.valid”, and “pct.valid”.
Argument to be passed to statistical functions. Defaults to
TRUE.
Number of significant digits to display. Defaults to
2.
Logical. Makes variables appears as columns, and stats as rows.
Defaults to FALSE.
Style to be used by pander when rendering
output tables; One of “simple” (default), “grid”, or
“rmarkdown”.
Logical. pander argument; When
TRUE, no markup characters will be used (useful when printing
to console). Defaults to TRUE when style is “simple”,
and FALSE otherwise.
Alignment of columns; “l” for left, “c” for center, or “r” for right (default). Has no effect on html tables.
Logical. Set to TRUE to omit headings.
Logical. Display label instead of variable name when label exists.
Logical. Should variable / data frame labels be displayed in
the title section? Default is TRUE.
Vector of weights having same length as x. NA
(default) indicates that no weights are used.
Logical. When set to TRUE, the
total count will be the same as the unweighted x. FALSE by
default.
Additional arguments passed to pander.
A matrix object containing the statistics, with extra attributes used by summarytool's print method.
# NOT RUN {
data(exams)
descr(exams)
descr(exams, transpose=TRUE)
descr(exams, stats = c("mean", "sd"))
data(tobacco)
with(tobacco, by(age, smoker, descr))
# }
Run the code above in your browser using DataLab