powered by
Computes a measure of how concentrated counts are around the center of a nominal variable, based on the centered plotting order.
central_concentration(df, var, top_k = 3, weighted = FALSE)
A numeric value between 0 and 1 representing the central concentration.
A data.frame or tibble containing the variable.
Character. Name of the nominal variable in df.
df
Numeric. Number of central categories to consider (default: 3).
Logical. If TRUE, applies a weight decreasing with distance from center.
central_concentration(categories, "animal") central_concentration(categories2, "animal", top_k = 5) central_concentration(categories3, "animal", weighted = TRUE)
Run the code above in your browser using DataLab