summaryStats | R Documentation |
This function calculates various descriptive statistics (robust and non-robust) for a specified variable or all variables in a given data frame or tibble.
summaryStats(x, var = NULL, digits = 2, robust = FALSE, drop.na = TRUE)
x |
A data frame or tibble. |
var |
A character vector specifying the variable(s) for which to calculate the summary statistics. If left as |
digits |
An integer specifying the number of significant digits to display after the decimal point in the output. |
robust |
A logical value indicating whether to compute robust descriptive statistics. If |
drop.na |
A logical value indicating whether to remove missing values ( |
A data frame containing the summary statistics for the specified variable(s).
Christian L. Goueguel
# Load the iris dataset
data(iris)
# Example1:
iris |> summaryStats()
# Example2:
iris |> summaryStats(
var = c("Sepal.Length", "Petal.Length"),
robust = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.