# perfect one-to-one association
cor_cramer(
x = c("a", "a", "b", "c"),
y = c("a", "a", "b", "c")
)
# still perfect: labels differ but mapping is unique
cor_cramer(
x = c("a", "a", "b", "c"),
y = c("a", "a", "b", "d")
)
# high but < 1: mostly aligned, one category of y repeats
cor_cramer(
x = c("a", "a", "b", "c"),
y = c("a", "a", "b", "b")
)
# appears similar by position, but no association by distribution
# (x = "a" mixes with y = "a" and "b")
cor_cramer(
x = c("a", "a", "a", "c"),
y = c("a", "a", "b", "b")
)
# numeric inputs are coerced to character internally
cor_cramer(
x = c(1, 1, 2, 3),
y = c(1, 1, 2, 2)
)
# logical inputs are also coerced to character
cor_cramer(
x = c(TRUE, TRUE, FALSE, FALSE),
y = c(TRUE, TRUE, FALSE, FALSE)
)
Run the code above in your browser using DataLab