Display plots in 2 & 3D with number of groups set and a choosen method. Possibility to hide 2D plots and save it.

plot_HCA_EM_Kmeans(
  method = "KM",
  pixel_df,
  nb_group,
  display_plot_3d = FALSE,
  display_plot_2d = TRUE,
  save_plot_2d = FALSE
)

Arguments

method

character. clustering method to chose among c("HCA", EM, "KM"). See `details` for more explications. Default is KM.

pixel_df

dataframe. output of "dist" function in "stats" library or "PCA_or_tSNE_on_pro_pres_est" function.

nb_group

int. number of groups for clustering. Please set nb_group to high than 1.

display_plot_3d

boolean. Display new window with 3d plot, default is FALSE.

display_plot_2d

boolean. Display 2d plots, default is TRUE.

save_plot_2d

boolean. Save in plot folder as .png file all 2d plots, default is FALSE.

Value

int vector. Group number for each pixel.

Details

`method` values are HCA : Hierarchical Cluster Analysis; EM : Expectation Maximisation; KM : K-means algorithm