| uplot_pca | R Documentation |
This function performs Principal Component Analysis (PCA) on a dataset, and visualizes the results in various ways, including a scatter plot of the first two principal components (PC1 vs PC2) and a Van Krevelen plot projected using PC1 values. The PCA is performed on the molecular formula data, aggregated by a grouping variable, and handles cases where columns exhibit zero variance (which cannot be included in PCA).
uplot_pca(
mfd,
grp,
int_col = "norm_int",
palname = "viridis",
col_bar = TRUE,
...
)
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. |
palname |
Color palette name for f_colorz() (viridis, magma, plasma, etc.). |
col_bar |
Logical. If |
... |
Additional arguments passed to methods. |
Principal Component Analysis (PCA) Plotting
A list containing:
pca |
The PCA model object (class |
t_score |
A data table of PCA scores (principal component values for each sample). |
fig_vk |
A Van Krevelen plot projected with PC1 values. |
fig_pca |
A scatter plot of the first two principal components (PC1 vs PC2). |
mfd |
The input data table, augmented with principal component values. |
The function uses prcomp for PCA and uplot_vk for the Van Krevelen plot.
uplot_vk for the Van Krevelen plot function.
Other plots:
uplot_cluster(),
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_ratios(),
uplot_reproducibility(),
uplot_ri_vs_sample(),
uplot_vk()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.