View source: R/uplot_cluster.R
| uplot_cluster | R Documentation |
This function plots the results of a cluster analysis and a multi-dimensional scaling (MDS) plot based on the input data. It first creates a hierarchical cluster dendrogram using the Bray-Curtis dissimilarity index, followed by an MDS plot for dimensionality reduction. The function outputs both plots side by side.
uplot_cluster(mfd, grp = "file_id", int_col = "norm_int", ...)
mfd |
data.table with molecular formula data as derived from
|
grp |
Character vector. Names of columns (e.g., sample or file identifiers) used to aggregate results. |
int_col |
Character. The name of the column that contains the intensity values to be used (e.g. for clustering or color coding). Default usually is "norm_int" for normalized intensity values. |
... |
Additional arguments passed to methods. |
Plot Cluster Analysis and Multi-Dimensional Scaling
A named list with two elements:
dendrogramA recordedplot object containing the hierarchical clustering
dendrogram generated from the Bray–Curtis dissimilarity matrix.
mdsA plotly object representing the two-dimensional
Multi-Dimensional Scaling (MDS) scatter plot.
This can be rendered interactively in HTML or converted to
a static ggplot object if needed.
The function always returns a list with these two components.
This function requires the vegan package for the Bray-Curtis
dissimilarity and MDS calculations.
Other plots:
uplot_cvm(),
uplot_dbe_minus_o_freq(),
uplot_dbe_vs_c(),
uplot_freq_ma(),
uplot_freq_vs_ppm(),
uplot_hc_vs_m(),
uplot_heteroatoms(),
uplot_isotope_precision(),
uplot_kmd(),
uplot_lcms(),
uplot_ma_vs_mz(),
uplot_ms(),
uplot_n_mf_per_sample(),
uplot_pca(),
uplot_ratios(),
uplot_reproducibility(),
uplot_ri_vs_sample(),
uplot_vk()
# Example with demo data
out <- uplot_cluster(mfd = mf_data_demo, grp = "file", int_col = "norm_int")
out$dendrogram
out$mds
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.