frequencies | R Documentation |
Generates frequency tables for all columns in a dataset, including valid percentages, cumulative percentages, and missing value statistics.
frequencies(data)
data |
A data frame or data structure containing the variables to analyze |
For each column in the input data, the function calculates and displays: * Frequency counts * Percentages of total observations * Valid percentages (excluding missing values) * Cumulative percentages * Summary of valid and missing observations
The output for each variable includes: * A frequency table with the above statistics * Count and percentage of valid observations * Count and percentage of missing observations * Total number of observations
Prints formatted frequency tables for each column in the dataset. Each table includes:
Var1 |
The unique values in the column |
Freq |
Frequency counts |
Percent |
Percentage of total observations |
ValidPercent |
Percentage excluding missing values |
CumulativePercent |
Cumulative valid percentages |
data <- data.frame(
gender = c("M", "F", "M", NA, "F"),
age = c(25, 30, NA, 40, 35)
)
frequencies(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.