View source: R/nmr_peak_clustering.R
nmr_peak_clustering | R Documentation |
Peak clustering
nmr_peak_clustering(
peak_data,
peak2peak_dist = NULL,
num_clusters = NULL,
max_dist_thresh_ppb = NULL,
verbose = FALSE
)
peak_data |
The peak list |
peak2peak_dist |
The distances obtained with nmr_get_peak_distances.
If NULL it is computed from |
num_clusters |
If you want to fix the number of clusters. Leave |
max_dist_thresh_ppb |
To estimate the number of clusters, we enforce a limit on how far two peaks of the same cluster may be. By default this threshold will be computed as 3 times the median peak width (gamma), as given in the peak list. |
verbose |
A logical vector to print additional information |
A list including:
The peak_data
with an additional "cluster" column
cluster: the hierarchical cluster
num_clusters: an estimation of the number of clusters
num_cluster_estimation: A list with tables and plots to justify the number of cluster estimation
peak_data <- data.frame(
NMRExperiment = c("10", "10", "20", "20"),
peak_id = paste0("Peak", 1:4),
ppm = c(1, 2, 1.1, 2.2),
gamma_ppb = 100
)
clustering_result <- nmr_peak_clustering(peak_data)
peak_data <- clustering_result$peak_data
stopifnot("cluster" %in% colnames(peak_data))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.