# Make the correspondence analysis :
# \donttest{
tabs <- table(forcats::gss_cat$race, forcats::gss_cat$marital)[-4,]
# tabs <- tabxplor::tab_plain(forcats::gss_cat, race, marital, df = TRUE)
res.ca <- FactoMineR::CA(tabs, graph = FALSE)
# Interactive plot :
graph.ca <- ggca(res.ca,
title = "Race by marital : correspondence analysis",
tooltips = c("row", "col"))
ggi(graph.ca) #to make the plot interactive
# Image plot :
ggca(res.ca,
title = "Race by marical : correspondence analysis",
text_repel = TRUE)
# }
Run the code above in your browser using DataLab