ggmca_3d {ggfacto}R Documentation

Interactive 3D Plot for Multiple Correspondence Analyses (plotly::)

Description

Interactive 3D Plot for Multiple Correspondence Analyses (plotly::)

Usage

ggmca_3d(
  res.mca,
  dat,
  cah,
  axes = 1:3,
  base_zoom = 1,
  remove_buttons = FALSE,
  cone_size = 0.15,
  view = "All",
  camera_view,
  aspectratio_from_eig = FALSE,
  title,
  ind_name.size = 10,
  max_point_size = 30,
  ...
)

Arguments

res.mca

An object created with FactoMineR::MCA.

dat

The data in which to find the cah variable, etc.

cah

A variable made with HCPC, to link the answers-profiles points who share the same HCPC class (will be colored the same color and linked at mouse hover).

axes

The axes to print, as a numeric vector of length 3.

base_zoom

The base level of zoom.

remove_buttons

Set to TRUE to remove buttons to change view.

cone_size

The size of the conic arrow at the end of each axe.

view

The starting point of view (in 3D) :

  • "Plane 1-2" : Axes 1 and 2.

  • "Plane 1-3" : Axes 1 and 3.

  • "Plane 2-3" : Axes 2 and 3.

  • "All" : A 3D perspective with Axes 1, 2, 3.

camera_view

Possibility to add a (replace 'view')

aspectratio_from_eig

Set to 'TRUE' to modify axes length based on eigenvalues.

title

The title of the graph.

ind_name.size

The size of the names of individuals.

max_point_size

The size of the biggest point.

...

Additional arguments to pass to ggmca.

Value

A plotly html interactive 3d (or 2d) graph.

Examples


data(tea, package = "FactoMineR")
res.mca <- MCA2(tea, active_vars = 1:18)
ggmca_3d(res.mca)

# 3D graph with colored HCPC clusters (cah)
res.mca_3axes <- MCA2(tea, active_vars = 1:18, ncp = 3)
cah <- FactoMineR::HCPC(res.mca_3axes, nb.clust = 6, graph = FALSE)
tea$clust <- cah$data.clust$clust
ggmca_3d(res.mca, dat = tea, cah = "clust")


[Package ggfacto version 0.3.0 Index]