descriptives | R Documentation |
Calculates comprehensive descriptive statistics for numeric columns in a dataset, including measures of central tendency, dispersion, and distribution shape.
descriptives(data)
data |
A data frame or matrix containing numeric columns to analyze |
The function automatically identifies and processes only numeric columns in the input dataset. All statistics are calculated excluding NA values. Results for mean, SD, median, IQR, skewness, and kurtosis are rounded for readability. Skewness and kurtosis calculations use functions from the DescTools package.
A data frame where each row represents a numeric variable from the input data, and columns contain the following statistics:
N: Number of non-missing observations
Missing: Number of missing values
Min: Minimum value
Max: Maximum value
Mean: Arithmetic mean
SD: Standard deviation
Median: Median value
IQR: Interquartile range (using type 3 calculation)
Skewness: Skewness coefficient
Kurtosis: Kurtosis coefficient (using method 2)
# Using with iris dataset
result <- descriptives(iris)
# Using with specific numeric columns
data <- data.frame(
age = c(25, 30, 35, NA, 40),
score = c(85, 90, 88, 92, 95)
)
result <- descriptives(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.